MEM_IN_STRUCT_P, again

Mark Mitchell mark@markmitchell.com
Wed Nov 18 19:15:00 GMT 1998


It looks to me like we set MEM_IN_STRUCT_P for something like:

 s->x[i]

given:

  struct s {
    double *x;
  };

  struct s* s;

That's no good; what if we have:

  double a;
  s->x = &a;

Then, since `a' is a scalar at a fixed address, and `s->x[i]' is a
MEM_IN_STRUCT_P reference at a non-varying address, we conclude they
can't alias.  But, they can if `i' is zero. 

This is another piece in an increasingly large pile against
MEM_IN_STRUCT_P.  I know we've discussed making this a ternary
attribute, so as to keep some of the optimizations involved, but
nobody is showing the inclination to actually write the code.  And,
we've got several examples where this "optimization" generates bad
code.

Let's turn this optimization off, for now.  If it matters, and someone
wants to do it right, we can turn it back on later.  If I submit
patches to do this, will they be accepted?

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com



More information about the Gcc-bugs mailing list