This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/14617] [tree-ssa] suboptimal code ('0' <= c && c <= '9') ? c - '0' : 0
- 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: Tue, 07 Feb 2012 20:18:59 +0000
- Subject: [Bug tree-optimization/14617] [tree-ssa] suboptimal code ('0' <= c && c <= '9') ? c - '0' : 0
- Auto-submitted: auto-generated
- References: <bug-14617-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14617
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-12-15 04:47:37 |2012-02-07 0:00
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-07 20:18:59 UTC ---
I have a patch which improves this to:
<bb 2>:
D.1957_3 = (unsigned int) c_2(D);
D.1958_4 = D.1957_3 + 4294967248;
if (D.1958_4 <= 9)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
D.1961_5 = (int) c_2(D);
D.1955_6 = D.1961_5 + -48;
<bb 4>:
# D.1955_1 = PHI <D.1955_6(3), 0(2)>
--- CUT ---
Note the addition is found via PRE on the RTL level though and then we convert
it to the an ifconversion but we should able to find that on TREE Level.