[Bug rtl-optimization/44838] [4.6 regression] RTL loop unrolling causes FAIL: gcc.dg/pr39794.c
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Jul 7 10:49:00 GMT 2010
------- Comment #22 from rguenth at gcc dot gnu dot org 2010-07-07 10:48 -------
(In reply to comment #21)
> Subject: Re: [4.6 regression] RTL loop
> unrolling causes FAIL: gcc.dg/pr39794.c
>
> > > > > > Consider this simplified example:
> > > > > >
> > > > > > for (i ...)
> > > > > > {
> > > > > > /*A*/ t = a[i];
> > > > > > /*B*/ a[i+1] = t;
> > > > > > }
> > > > > > MEM_ATTRS would indicate that memory references in A and B do not alias.
> > > > >
> > > > > but this is clearly wrong, since B in iteration X aliases with A in iteration
> > > > > X+1.
> > > > > So, not a problem in unroller.
> > > >
> > > > It is not wrong. You have the two identical pointers p = &a[i] and
> > > > q = p + 1. *p and *q do not alias. Never.
> > >
> > > Well, then you have some other definition of aliasing than me. For me, two
> > > memory references M1 and M2 do not alias, if on every code path, the locations
> > > accessed by M1 and M2 are different. With this definition, *p and *q may
> > > alias,
> > > as the example above shows. What is your definition?
> > >
> >
> > My definition is that the two statements in sequence A, B have a
> > true dependence if stmt B accesses memory written to by A.
> > Thus, in this context *p and *q do not "alias" (and this is what
> > the scheduler and every other optimization pass queries).
>
> what do you mean by "statements in sequence"?
statement B executes after A.
Note that the issue we run into here is partly (or completely?) due to
the fact that the pointer variables in MEM_ATTRs are SSA names and
that we still honor their single-definition (and thus trivial
equality) property on RTL.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44838
More information about the Gcc-bugs
mailing list