Question on scalar replacement
Diego Novillo
dnovillo@redhat.com
Mon Jun 14 14:17:00 GMT 2004
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.
More information about the Gcc
mailing list