patch: Sign-extension bug (?) in immed_double_const

Jeffrey A Law law@cygnus.com
Thu Sep 14 08:26:00 GMT 2000


  In message <20000830230940.A8409@daikokuya.demon.co.uk>you write:
  > If it is a good fix, I'll add something to the comment, too.
  > 
  > Neil.
  > 
  > 	* varasm.c (immed_double_const):  Sign extend constants that
  > 	would be signed in their mode.
This can't be correct.

Consider :

BITS_PER_WORD 32
HOST_BITS_PER_WIDE_INT 32
width 64
i0 0x80180481
i1 0

Your change will turn that into

i0 0xffffffff
i1 0x0

Which can't be correct.

The "|| i1 == 0" clause seems totally bogus to me.  I have no idea what you
were trying to accomplish with that change, but it can't be right as written.

jeff



More information about the Gcc-patches mailing list