Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Nikita Schmidt <cetus@snowball.ucd.ie>
To: axp-list@redhat.com
Subject: Re: Weird Compaq CCC / GCC interaction ?
Date: Tue, 26 Sep 2000 11:12:52 +0100	[thread overview]
Message-ID: <20000926111252.A17671@snowball.ucd.ie> (raw)
In-Reply-To: <010C86D15E4D1247B9A5DD312B7F5AA70BEC27@stegosaurus.bristol.quadrics.com>; from addy@quadrics.com on Tue, Sep 26, 2000 at 09:55:12AM +0100

On Tuesday, 26 Sep, David Addison wrote:
>  
> Anyone know what's wrong ... is this a bug with ccc or gcc ?
>  
This looks like a bug in gcc - see below why.

> cat fn.c
>  
> unsigned int fn()
> {
>     return (0xc00fc00f);
> }
>  
[...]
>  
> objdump -d fn_gcc.o 
>  
> fn_gcc.o:     file format elf64-alpha
>  
> Disassembly of section .text:
>  
> 0000000000000000 <fn>:
>    0:   0f c0 1f 20     lda     v0,-16369(zero)
>    4:   10 c0 00 24     ldah    v0,-16368(v0)
>    8:   20 f6 01 48     zapnot  v0,0xf,v0
>    c:   01 80 fa 6b     ret     zero,(ra),0x1
>         ...
> 
> objdump -d fn_ccc.o 
>  
> fn_ccc.o:     file format elf64-alpha
>  
> Disassembly of section .text:
>  
> 0000000000000000 <fn>:
>    0:   10 c0 1f 24     ldah    v0,-16368(zero)
>    4:   1f 04 ff 47     nop
>    8:   0f c0 00 20     lda     v0,-16369(v0)
>    c:   01 80 fa 6b     ret     zero,(ra),0x1
> 
>  
> GCC is inserting a ZAPNOT instruction to zero the top 4-bytes - is this
> correct ?

According to the Calling Standard for Alpha Systems, Section 4.1.5 "Unused
Bits in Passed Data," both signed and unsigned ints should be passed
sign-extended in registers.  Gcc is compatible with itself, but not with
any other compiler which follows the documented conventions.  If gcc
claims to be standards compliant, this is a bug; please submit a report.

Nikita




  parent reply	other threads:[~2000-09-26 10:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-26  8:55 Weird Compaq CCC / GCC interaction ? David Addison
2000-09-26  9:41 ` Andrei A. Dergatchev
2000-09-26 10:12 ` Nikita Schmidt [this message]
2000-09-26 16:02   ` Michal Jaegermann
2000-09-26 12:23 ` Ivan Kokshaysky
2000-09-26 13:57 ` Ivan Kokshaysky
  -- strict thread matches above, loose matches on Subject: below --
2000-09-26 13:59 David Addison
2000-09-26 15:36 ` Ivan Kokshaysky
2000-09-26 17:25 Larry Sendlosky
2000-09-26 18:01 ` Michal Jaegermann
2000-09-27  3:17 ` Richard Henderson
2000-09-26 17:47 David Addison
2000-09-26 18:52 Larry Sendlosky
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox