This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/47271] [4.6 Regression] if-conversion removes a test (if), the function generates invalid outputs
- From: "spop at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Jan 2011 18:45:51 +0000
- Subject: [Bug tree-optimization/47271] [4.6 Regression] if-conversion removes a test (if), the function generates invalid outputs
- Auto-submitted: auto-generated
- References: <bug-47271-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47271
--- Comment #5 from Sebastian Pop <spop at gcc dot gnu.org> 2011-01-18 18:45:27 UTC ---
In this loop:
for (i=0, nops=0 ; i<codelen ; i += ((codestr[i] >= 90) ? 3 : 1))
{
addrmap[i] = i - nops;
if (codestr[i] == 9)
nops++;
}
it looks like this part: i += ((codestr[i] >= 90) ? 3 : 1)
is miscompiled into:
# i_35 = PHI <i_19(8), 0(2)>
iftmp.0_4 = [cond_expr] D.2702_12 != 9 ? 3 : 1;
i_19 = iftmp.0_4 + i_35;
the predicate for the increment is wrongly computed.