This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/35357] Loop peeling not happening
- From: "xinliangli at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Oct 2012 16:55:48 +0000
- Subject: [Bug tree-optimization/35357] Loop peeling not happening
- Auto-submitted: auto-generated
- References: <bug-35357-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35357
--- Comment #2 from davidxl <xinliangli at gmail dot com> 2012-10-26 16:55:48 UTC ---
(In reply to comment #1)
> What is the expected optimization and what is its benefit?
Should be transformed into the following the simplified loop body.
void foo(int n)
{
int i;
if (n > 0) {
for ( i = 0; i < n; i++)
{
b[i*2] = a[3*i+1];
b[i*2] +=1;
}
b[i*2] = a[3*i + 1];
}
}
Icc at O2 distributes the loop body:
for ( i = 0; i <= n; i++)
{
b[i*2] = a[3*i+1];
}
for ( i = 0; i < n; i++)
{
b[i*2] += 1;
}