On Mon, 17 Jun 2019, Jan Hubicka wrote:

> > 
> > get_alias_set already handles VCEs properly.  Btw I've said
> 
> I see - i keep thinking of get_alias_set as a simple accessor to type's
> alias set which it is not.  It may make sense to separate these two
> later.
> 
> > BIT_FIELD_REF has the same issue but you didn't include that
> > case below.
> 
> Sorry, missed that in your reply.  I am testing the fix.
> 
> What about aliasing_component_refs.  When I have VCE in the the path,
> I suppose I do not want to consider the stuff after VCE as part of path
> and also while testing whether one path can be continuation from other
> I want to start from outermost VCE rather than ref_type, right?

Yeah, when searching for base1/2 you want to initialize ref1/2p
like

 while (handled_component_p (base1))
  {
    if (TREE_CODE (base1) == VIEW_CONVERT_EXPR
        || TREE_CODE (base1) == BIT_FIELD_REF)
     ref1p = &TREE_OPERAND (base1, 0);
    base1 = TREE_OPERAND (base1, 0);
  }

and then instead of refp = &ref1/2 do refp = ref1/2p for the searches.

So not use the type of the innermost(!) VIEW_CONVERT_EXPR but its
base (same for BIT_FIELD_REF).

> 
> So I would go for adjusting the ref1 and ref2 accordingly in the first
> walk of handled components. alias set needs no updating since that is
> aready done earlier.

Yes, adjusting ref1/2 is also possible.

Richard.

> Honza
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany;
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah; HRB 21284 (AG Nürnberg)

Reply via email to