[Bug tree-optimization/51783] Missed optimization for X ==/!= (signed type) ((unsigned type) Y + Z)
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jan 7 18:58:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51783
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-07 18:57:52 UTC ---
(In reply to comment #2)
> Well, IMHO it is still valid in the case of argument of ne/eq comparison, as
> indeed here sign and wrap-around doesn't matter.
Maybe for this exact IR but what happens if someone later on used c somewhere
else? Anyways I don't think this is a missed optimization at all because the
code produced will be the same as PLUS_EXPR for both unsigned and signed int
types will be expanded the same. The only thing that is removed is the cast
which is a nop here.
More information about the Gcc-bugs
mailing list