This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21829] New: [4.1 Regression] missed jump threading after unroller
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 May 2005 19:06:14 -0000
- Subject: [Bug tree-optimization/21829] New: [4.1 Regression] missed jump threading after unroller
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take the following code:
int test(int v)
{
int x = 0;
for (int u=0;u<2;u++)
{
if (u>v) // v is input-arg the compiler can't deside at compiletime
{
if (u%2==1) // can only happen for u==1 (so loops for 0 and 2 does not do
x++; // anything. Hoped gcc would notice when unrolling.
}
}
return x;
}
We get:
<bb 0>:
if (v_8 < 0) goto <L1>; else goto <L15>;
<L15>:;
if (v_8 <= 0) goto <L1>; else goto <L3>;
<L1>:;
# x_1 = PHI <0(3), 1(1)>;
<L3>:;
return x_1;
}
Notice that the if in L15 is always true.
The 4.0 branch gets this correct.
--
Summary: [4.1 Regression] missed jump threading after unroller
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: minor
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21829