This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/30521] "if (i == n) ++i;" or "i += i == n;"?
- 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: Sun, 04 Mar 2012 01:44:32 +0000
- Subject: [Bug middle-end/30521] "if (i == n) ++i;" or "i += i == n;"?
- Auto-submitted: auto-generated
- References: <bug-30521-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30521
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-04 01:44:32 UTC ---
We could do this at the tree level. First do add a late PHIOPT which does the
conversion to a COND_EXPR and then simplify a?b+1:b into a+b. Likewise for
a?b+2:b+1 to a+b+1.