PATCH to make return in memory explicit

Jason Merrill jason@redhat.com
Sat Aug 7 16:24:00 GMT 2004


The C++ front end has been making return in memory explicit by adding the
return slot address as an argument and setting
CALL_EXPR_HAS_RETURN_SLOT_ADDR; this patch changes the gimplifier to do
that transformation for other front ends, so that the temporaries involved
are explicit in the GIMPLE, not generated at expand time.

The goal was to be able to change the fb_either in gimplify_addr_expr to
fb_lvalue, but that still doesn't work, as the return type in
c99-array-lval-1.c doesn't satisfy aggregate_value_p on some targets.  As
it turns out, using fb_either has the desired effect of making the
temporary explicit.

Tested x86_64-pc-linux-gnu, applied to trunk.

2004-08-07  Jason Merrill  <jason@redhat.com>

	* gimplify.c (gimplify_call_expr): Make return in memory explicit.
	(gimplify_modify_expr_rhs): Likewise.
	* c-common.c (c_warn_unused_result): Check TREE_USED before
	warning about a CALL_EXPR with an unused value.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-patch
Size: 4685 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040807/201b06cc/attachment.bin>


More information about the Gcc-patches mailing list