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>, Jason Merrill <jason at redhat dot com>
- Date: Mon, 14 Jun 2004 10:17:34 -0400
- Subject: Re: Question on scalar replacement
- Organization: Red Hat Canada
- References: <10406141407.AA05618@vlsi1.ultra.nyu.edu>
On Mon, 2004-06-14 at 10:07, Richard Kenner wrote:
> Ah, sorry. Try this:
>
> - tree var = TREE_OPERAND (stmt, 0);
> + tree var = get_base_address (TREE_OPERAND (stmt, 0));
>
> Yeah, that does it. And also fixes a half dozen similar cases in
> other Ada RTS files. I can now compile the first 18 files without
> ICE, error, or warning.
>
Sure. Now, that I think a bit more about this, it's surprising that we
haven't run into this before. I don't see anything wrong with
MODIFY_EXPR <COMPONENT_REF, CALL_EXPR> wrt GIMPLE, but I do know that we
never get this in C. The C gimplifier always creates a scalar LHS:
a.f = foo ()
is gimplified into
temp = foo ()
a.f = temp
Jason, is a.f = foo() valid GIMPLE? If not, then the bug is in the
gimplifier. Otherwise, the patch I sent should be OK.
Thanks. Diego.