[Bug tree-optimization/80281] [5/6/7 Regression] Wrong constant folding
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Apr 3 08:37:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80281
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #7)
> (In reply to Richard Biener from comment #6)
> > We need to keep the type of the negation, thus
>
> If the addition was unsigned, you don't want to turn it into a signed
> subtraction either.
Suggestion? Apart from disabling the transform when the negate was unsigned
but the plus will be signed for the original pattern? This set of patterns was
supposed to be safe regardless of overflow... (which they are unless we factor
in conversions...)
So maybe if TYPE_OVERFLOW_WRAPS of the plus and the negate doesn't agree use an
unsigned type throughout?
More information about the Gcc-bugs
mailing list