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] Fix IVOPTs problem


On Thu, 2005-08-11 at 16:51 -0400, Daniel Berlin wrote:
> This unfortunately isn't the only case we lose precision when we perform 
> optimization into semantically equivalent code related to structure 
> accesses.
> 
> Any time we turn a single pointer deref into a pointer to field access, we 
> lose precision right now.
> 
> p_12->a = 5;
> p_12->b = 6;
> 
> vs
> 
> q_13 = &p_12->a;
> *q_13 = 5;
> q_14 = &p_12->b;
> *q_14 = 6;
> 
> 
> (The second will have points-to-sets on the pointers that have exactly one 
> SFT each.  THe first will have two SFT's each).
> 
> This is because of how the operand scanner works. The points-to set is 
> attached to the pointer, and not pruned based on what the rest of the 
> access expression is.
Yes.  This was one of the things I wanted to fix with my aliasing
changes, but alas, certain things have happened in my life which have
prevented me from finishing that work.



> > I don't know our aliasing code well enough if there's a way to avoid
> > the loss in precision when we transform the structure + array access
> > into pointer arithmetic.
> 
> We can avoid some of the loss in the new aliaser (because it can figure 
> out what offsets you can possibly point to, and what fields those 
> offsets land on), but I punted on that for 4.1 in order to make deadlines 
> because Diego wanted to put the new aliaser in :).
Note that with this particular testcase, there isn't enough information
in the TARGET_MEM_REF to know what the aliasing relationships should be.
To properly determine the aliasing relationships we need to look at the
whole loop to determine what values the index variable may have.

Jeff


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