This was fun to track down
Torbjorn Granlund
tege@nada.kth.se
Sat Sep 27 13:40:00 GMT 1997
Note the following comment in convert_modes; it may apply to any attempt
to use gen_lowpart:
/* There is one case that we must handle specially: If we are converting
a CONST_INT into a mode whose size is twice HOST_BITS_PER_WIDE_INT and
we are to interpret the constant as unsigned, gen_lowpart will do
the wrong if the constant appears negative. What we want to do is
make the high-order word of the constant zero, not all ones. */
An `unsigned' constant that appears negative should never be generated.
Such constants should use const_double.
I think the gen_lowpart code connected to that comment is wrong. When that
code went in, I suggested that the bug in the caller that relied on that
bogus behaviour be fixed instead.
Now gcc's constant representation is ambiguous.
More information about the Gcc
mailing list