This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/35357] New: 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: 25 Feb 2008 05:01:21 -0000
- Subject: [Bug middle-end/35357] New: Loop peeling not happening
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
//David Li
Loop peeling is special case of index splitting. Gcc has support for this
(under -O3 -funrool_loops, also -fno-tree-vectorize for the simple case), but
it does not happen for the following cases:
int a[100];
int b[1000];
void foo(int n)
{
int i;
for ( i = 0; i <= n; i++)
{
b[i*2] = a[3*i+1];
if (i < n)
b[i*2] +=1;
}
}
---------------------
int a[100];
int b[1000];
void foo(int n)
{
int i;
for ( i = 0; i < n; i++)
{
if (i==0) b[i*2] +=1;
b[i*2] = a[3*i+1];
}
}
--
Summary: Loop peeling not happening
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: xinliangli at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35357