This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: UltraSPARC 16-bit assignments severely broken [analysis]



>> (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...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]