[PATCH] Fix PR middle-end/17746

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Tue Oct 26 13:34:00 GMT 2004


    In light of this, my interpretation is that Richard's strategy was to
    force get_inner_reference to "temporarily" exit, so that the
    VIEW_CONVERT_EXPR expander can take control and step up the alignment:

Perhaps, but I don't rememember that and it's a kludge if so.  If the
VIEW_CONVERT_EXPR is the outermost operation, we may need to "step
things up", but that doesn't use get_inner_reference.  If it's in the
middle of a reference chain, I'm not convinced that anything has to be
done, but if it does, then somebody else ought to do it.  Admittedly,
this is a complex case.

    About the handled_component_p/get_inner_reference discrepancy: a
    widely used idiom is

      while (handled_component_p (t))
        t = TREE_OPERAND (t, 0);

    So if we made handled_component_p reject VIEW_CONVERT_EXPRs with the
    TYPE_ALIGN_OK flag, I suspect we would probably need to add explicit
    
      || ((TREE_CODE (t) == VIEW_CONVERT_EXPR && TYPE_ALIGN_OK (t) && ...)

    all over the place.

Indeed that's out of the question.  Actually, my goal is to get rid of
handled_component_p in the first place and just use REFERENCE_CLASS_P.
That was part of the motivation of changing some codes to tcc_reference.



More information about the Gcc-patches mailing list