[Bug tree-optimization/30738] suboptimal code for min, max, et al
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Feb 9 10:54:00 GMT 2007
------- Comment #1 from rguenth at gcc dot gnu dot org 2007-02-09 10:54 -------
Confirmed. This is because we don't optimize
int test_min_ref(int, int) (x, y)
{
int D.2516;
int D.2517;
const int & x;
int D.2458;
<bb 2>:
# VUSE <x_10(D)>
D.2516_6 = x;
# VUSE <y_11(D)>
D.2517_7 = y;
if (D.2516_6 < D.2517_7) goto <L1>; else goto <L2>;
<L1>:;
# x_8 = PHI <&y(2), &x(3)>
<L2>:;
# VUSE <x_10(D), y_11(D)>
D.2458_2 = *x_8;
return D.2458_2;
}
We could "backward propagate" *a_8 into the PHI node. This missing
optimization
also keeps x and y addressable, which is bad.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Component|c++ |tree-optimization
Ever Confirmed|0 |1
GCC build triplet|sparc-sun-solaris |
GCC host triplet|sparc-sun-solaris |
GCC target triplet|sparc-sun-solaris |
Keywords| |missed-optimization
Known to fail| |4.3.0
Last reconfirmed|0000-00-00 00:00:00 |2007-02-09 10:54:11
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30738
More information about the Gcc-bugs
mailing list