This is the mail archive of the gcc-patches@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: x86_64 and HOST_WIDE_INT changes fix


On May  5, 2001, Jan Hubicka <jh@suse.cz> wrote:

> ! 		hi_half[num] = (1 << 31) != 0 ? constm1_rtx : const0_rtx;

Undefined behavior in 1 << 31 with 16-bit ints.

> ! 	      lo_half[num] = GEN_INT (trunc_int_for_mode (CONST_DOUBLE_LOW (op), SImode));
> ! 	      hi_half[num] = GEN_INT (trunc_int_for_mode (CONST_DOUBLE_HIGH (op), SImode));

I believe CONST_DOUBLE_LOW and CONST_DOUBLE_HIGH are already
properly sign-extended.  I couldn't find any case in which this was
not true, so the trunc_int_for_mode is probably unnecessary.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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