This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on scalar replacement
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 14 Jun 2004 09:58:21 -0400
- Subject: Re: Question on scalar replacement
- Organization: Red Hat Canada
- References: <10406141352.AA05468@vlsi1.ultra.nyu.edu>
On Mon, 2004-06-14 at 09:52, Richard Kenner wrote:
> > The RHS is a call, so it calls scalarize_call_expr. This seems to look
> > inside the args, but only check the RHS for is_sra_candidate_decl. From
> > other code, it looks like checking is_sra_candidate_ref seems correct.
>
> Do we get inside this if() statement in scalarize_call_expr()?
>
> /* If the LHS of the assignment is a scalarizable structure, insert
> copies into the scalar replacements after the call. */
> if (is_sra_candidate_decl (var))
>
> No. That's what I was trying to say. VAR is a COMPONENT_REF here.
>
Ah, sorry. Try this:
Index: tree-sra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-sra.c,v
retrieving revision 2.6
diff -d -u -p -r2.6 tree-sra.c
--- tree-sra.c 13 Jun 2004 19:48:53 -0000 2.6
+++ tree-sra.c 14 Jun 2004 13:57:53 -0000
@@ -1012,7 +1012,7 @@ scalarize_call_expr (block_stmt_iterator
/* Scalarize the return value, if any. */
if (TREE_CODE (stmt) == MODIFY_EXPR)
{
- tree var = TREE_OPERAND (stmt, 0);
+ tree var = get_base_address (TREE_OPERAND (stmt, 0));
/* If the LHS of the assignment is a scalarizable structure, insert
copies into the scalar replacements after the call. */
Diego.