This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
jump bypass confuses noce_try_minmax
- From: DJ Delorie <dj at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 21 Nov 2003 20:44:46 -0500
- Subject: jump bypass confuses noce_try_minmax
Consider this test case:
int foo(int a)
{
if (a >= 7)
a = 7;
if (a < -8)
a = -8;
return a;
}
On a target with smin/smax insns, it can be coded trivially:
a = smin(a,7);
a = smax(a,-8);
return a;
However, the "jump bypass" optimization changes it to this:
int foo(int a)
{
if (a >= 7)
a = 7;
else if (a < -8)
a = -8;
return a;
}
And now noce_try_minmax cannot match the min operation, and you end up
with conditional branches and such. Note that adding asm("") between
the conditionals yields the expected output.
Should jump bypassing be deferred until after ifcvt?
Or could bypassing be skipped on targets with min/max operations?