This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] for PR17474


Hello,

> > > > this handles just the cases when the base variable does not have
> > > > a type memory tag; in such case the variable itself acts as an
> > > > operand in VUSES/VDEFS (well -- I guess; it seems to work this way...)
> > > >
> > > If the base variable didn't have an alias tag already, something is
> > > _very_ wrong.  The base variable is dereferenced, so it must have a tag
> > > (either type or name).  If that's not the case, the only graceful thing
> > > you can do here is ICE.
> > 
> > then you are going to ICE very often.  For example in the following
> > program
> > 
> > int arr[100];
> > 
> > void xxx(void)
> > {
> >   int i;
> > 
> >   for (i = 0; i < 100; i++)
> >     arr[i] = i;
> > }
> > 
> > arr does not have type memory tag (well, did not have in time I wrote
> > this piece of code few months ago; perhaps this changed since then?)
> > 
> arr is not a pointer.  Of course it doesn't have a tag.  That function
> should only try to copy aliasing information out of pointers (I had the
> impression that this function only takes care of pointer dereferences).

no, it takes care of the situation when memory reference is replaced by
a reference through pointer.  If we perform strength reduction in the
example above, producing

int *tmp;

for (tmp = &arr, i = 0; i < 100; tmp++, i++)
  *tmp = i;

We need to set up the memory tag for tmp.

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]