This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: UltraSPARC 16-bit assignments severely broken [analysis]
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: UltraSPARC 16-bit assignments severely broken [analysis]
- From: "Charles M. Hannum" <root at ihack dot net>
- Date: Mon, 24 Jul 2000 20:37:52 -0400 (EDT)
- Cc: gcc-bugs at gcc dot gnu dot org
>> (insn 21 19 22 (set (reg:HI 110)
>> (const_double (const_int 0 [0x0]) -32768 [0xffff8000] 0 [0x0] 0 [0x0] 0 [0x0] 0 [0x0])) -1 (nil)
>> (nil))
>
> This is wrong. It should be:
>
> (insn 21 19 22 (set (reg:HI 110)
> (const_int -32768)) -1 (nil)
> (nil))
This is a special case for cross-compiling from a 32-bit platform.
See:
if (TARGET_ARCH64
&& HOST_BITS_PER_WIDE_INT != 64
&& (INTVAL (op1) & 0x80000000) != 0)
{
There's a comment elsewhere (that I'm failing to find now) that
suggests this is because somewhere in the bowels of the optimizer it
assumes that the value will be sign-extended.
Of course, given that we're doing a sethi, the upper bits don't
actually matter...