This is the mail archive of the gcc@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: Question on scalar replacement


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.


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