[Bug middle-end/35885] unsigned long long and while loop evaluation regression?

2008-04-14 Thread wilson at gcc dot gnu dot org


--- Comment #5 from wilson at gcc dot gnu dot org  2008-04-15 00:25 ---
Gcc-2.5.8 uses the code I suggested was correct.  gcc-2.6.3 does not.  The
ChangeLog entry is

Fri Aug  5 12:29:42 1994  Jim Wilson  ([EMAIL PROTECTED])

* expmed.c (expand_mult): Accept DImode for synth_mult only if
CONST_DOUBLE_HIGH is zero.  Reject negative values for synth_mult
if the mode is larger than HOST_BITS_PER_INT.  Don't do the
negate_variant if the mode is larger than HOST_BITS_PER_INT.

So it seems that we used to allow any constant that would fit in a signed HWI,
then I found a bug with negative values so I changed it to any constant that
would fit in an unsigned HWI.  Now we found another bug with a constant that
doesn't fit in a signed HWI but does fit in an unsigned HWI.

So now the apparent solution is to only accept positive values that fit in a
signed HWI.  But of course such values should never be found in a CONST_DOUBLE
anyways.  If they fit in a signed HWI they would have been emitted as a
CONST_INT in the first place.  I think we should just drop all of this
CONST_DOUBLE nonsense.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35885



[Bug middle-end/35885] unsigned long long and while loop evaluation regression?

2008-04-11 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2008-04-12 03:10 ---
I think this is one of the reasons why x86 should change to HWI is 64bits, it
will get the same code generation between using -m32 on x86_64 and i?86.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org
  Component|c   |middle-end
  GCC build triplet|several |
   GCC host triplet|several |
 GCC target triplet|several |HWI == 32bits


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35885