UltraSPARC 16-bit assignments severely broken [analysis]
Charles M. Hannum
root@ihack.net
Mon Jul 24 17:46:00 GMT 2000
>> (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...
More information about the Gcc-bugs
mailing list