This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR middle-end/17746
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: ebotcazou at libertysurf dot fr
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Oct 04 18:19:49 EDT
- Subject: 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.