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 PR middle-end/17746


    expand_expr_addr_expr_1 is passed the following tree:
    
      COMPONENT_REF
        VIEW_CONVERT_EXPR <record_type1 ... align-ok>
          INDIRECT_REF <record_type2>
            VAR_DECL <pointer_type <record_type2>>

    expand_expr_addr_expr_1 essentially uses get_inner_reference to
    recurse until it finds an interesting node, here the INDIRECT_REF
    node.  This works fine on x86 but not always on SPARC because
    get_inner_reference may refuse to look through the VIEW_CONVERT_EXPR
    because of

Then the above is not valid!  handled_component_p and get_inner_reference
must always agree on what's handled.  The bug is in handled_component_p.
    
    The proposed fix is to teach expand_expr_addr_expr_1 to look itself
    through the VIEW_CONVERT_EXPR nodes that "step up" the alignment, but
    only if they carry the TYPE_ALIGN_OK flag.  

In that case get_inner_reference should *also* look at TYPE_ALIGN_OK,
as should handled_component_p.


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