store_expr, expr_size, and C++
Steve Ellcey
sje@cup.hp.com
Mon Feb 26 22:04:00 GMT 2007
I am looking at PR target/30826 (an IA64 ABI bug) and have come up with
a patch that basically involves turning off the
CALL_EXPR_RETURN_SLOT_OPT optimization in some instances and forcing GCC
to create a temporary for the (large aggragete) return value of a
function and then copying that temporary value to the desired target.
The problem I am running into is with C++ code in store_expr. I get to
this if statement:
if ((! rtx_equal_p (temp, target)
|| (temp != target && (side_effects_p (temp)
|| side_effects_p (target))))
&& TREE_CODE (exp) != ERROR_MARK
/* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
but TARGET is not valid memory reference, TEMP will differ
from TARGET although it is really the same location. */
&& !(alt_rtl && rtx_equal_p (alt_rtl, target))
/* If there's nothing to copy, don't bother. Don't call
expr_size unless necessary, because some front-ends (C++)
expr_size-hook must not be given objects that are not
supposed to be bit-copied or bit-initialized. */
&& expr_size (exp) != const0_rtx)
and I hit a gcc_assert when calling expr_size(). Even if I avoided this
somehow I would hit it later when calling:
emit_block_move (target, temp, expr_size (exp),
(call_param_p
? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
So my question is: is there a way to handle this copy/assignment in C++
without depending on expr_size. I noticed PR middle-end/30017 (turning
memcpys into assignments) which seems to have some of the same issues of
getting expr_size for C++ expressions but that defect is still open so
it doesn't look like there is an answer yet.
Anyone have some ideas on this problem?
Steve Ellcey
sje@cup.hp.com
More information about the Gcc
mailing list