> > OK, I see.  Then the only way out I can think of is to stop going up the
> > chain of COMPONENT_REFs as soon as the offset becomes negative.
>
> Yeah, that sounds like a better solution.

PR ada/51775 shows that this pessimizes though because if you have an enclosing 
sub-component at offset 0 on the LHS and not on the RHS, and you're using the 
model of the LHS for the RHS, you'll build a convoluted (but correct) MEM on 
the RHS, and this is apparently enough to thwart FRE/PRE and the likes in some 
simple cases:

  t$F$i2_9 = MEM[(struct pack9__r2 *)y_1(D)].F.i2;
  D.2233_3 = y_1(D)->i2;

The compiler doesn't see that D.2233_3 == t$F$i2_9.  Additionally using the 
type trick would help, at least for PR ada/51775 and I guess in most cases.  

Thoughts?

-- 
Eric Botcazou

Reply via email to