PATCH to gimplify_modify_expr_rhs to make return slot explicit

Jason Merrill jason@redhat.com
Fri Mar 4 21:21:00 GMT 2005


I'm no longer sure this patch is such a good idea.  When I looked into the
failures, they turned out to be problems with various bits of code not
dealing with CALL_EXPR_HAS_RETURN_SLOT_ADDR.  One was with code that
assumes that a call to a const function has no side-effects, which is not
true if the call has CALL_EXPR_HAS_RETURN_SLOT_ADDR set.

...which led me to think that maybe this transformation isn't a very good
idea; it makes the modification of the target less explicit, while most of
gimplification is trying to make all effects more explicit.

We do still need to make the caller-side return slot optimization explicit;
the mudflap problem illustrates this, as does c++/19317, where both caller
and callee share the return slot with another variable, leading to chaos.
Any ideas on a better way to express this?  Would making it a property of
the MODIFY_EXPR make sense?

Jason



More information about the Gcc-patches mailing list