This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51783] Missed optimization for X ==/!= (signed type) ((unsigned type) Y + Z)
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 Jan 2012 18:57:52 +0000
- Subject: [Bug tree-optimization/51783] Missed optimization for X ==/!= (signed type) ((unsigned type) Y + Z)
- Auto-submitted: auto-generated
- References: <bug-51783-4@http.gcc.gnu.org/bugzilla/>
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.