This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21591] New: not vectorizing a loop with access to structs
- 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: 15 May 2005 19:01:53 -0000
- Subject: [Bug tree-optimization/21591] New: not vectorizing a loop with access to structs
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Take the following C code (reduced from Java code and what the Java front-end produces).
We cannot vectorize the second loop
struct a
{
int length;
int a1[256];
};
struct a *malloc1(__SIZE_TYPE__) __attribute__((malloc));
void free(void*);
void f(void)
{
struct a *a = malloc1(sizeof(struct a));
struct a *b = malloc1(sizeof(struct a));
struct a *c = malloc1(sizeof(struct a));
int i;
for (i = 0; i < 256; i++) {
b->a1[i] = i;
c->a1[i] = i;
}
for (i = 0; i < 256; i++) {
a->a1[i] = b->a1[i] + c->a1[i];
}
free(a);
free(b);
free(c);
}
Here is what we get from the dump:
t.c:21: note: not vectorized: can't determine dependence between: b_5->a1[i_12] and a_3->a1[i_12]
--
Summary: not vectorizing a loop with access to structs
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
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=21591