[Bug tree-optimization/37573] [4.4 Regression] gcc-4.4 regression: incorrect code generation with -O1 -ftree-vectorize

sebpop at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Oct 22 16:11:00 GMT 2008



------- Comment #12 from sebpop at gmail dot com  2008-10-22 16:10 -------
Subject: Re:  [4.4 Regression] gcc-4.4 regression: incorrect code generation
with -O1 -ftree-vectorize

> common base.  Consider &s.c[1] and &s + i, obviously the accesses can
> overlap - would you still say so if the base address of the first one
> would be &s.c[0]?

Yes, in the case &s.c[1] versus &s.c[0], we still have to consider the
arrays to potentially overlap.

> (really the base address of a non-variable access is the access
> itself, right?  &s.c[1] in this case)

No, it cannot be &s.c[1] here.  The base object for arrays in structs
should be the struct itself.

The base address tells you what memory object is accessed with an
offset.  For structs, you are allowed to access any of their contents
using arithmetic.  For instance in:

struct s {
  int a[2];
  int c[20];
}

you could access s.c[10] from the address of struct s with: &s.a + 12.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37573



More information about the Gcc-bugs mailing list