diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1993-11-24 07:02:20 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1993-11-24 07:02:20 -0500 |
commit | e287fd6e75fbf1bc9078d974b5ee3aa52510e9c6 (patch) | |
tree | e53747445062648f9eec20f994c33d97c3e192c0 /gcc | |
parent | 0776af7805bf15e1a3f5a25a7e0f4b43b4bd497b (diff) | |
download | gcc-e287fd6e75fbf1bc9078d974b5ee3aa52510e9c6.zip gcc-e287fd6e75fbf1bc9078d974b5ee3aa52510e9c6.tar.gz gcc-e287fd6e75fbf1bc9078d974b5ee3aa52510e9c6.tar.bz2 |
(expand_expr, case ADDR_EXPR): Also pass const0_rtx if necessary, to avoid multiple cleanup runs.
(expand_expr, case ADDR_EXPR): Also pass const0_rtx if necessary, to
avoid multiple cleanup runs.
(expand_expr, case WITH_CLEANUP_EXPR): Pass const0_rtx if necessary,
to keep the recursive call from running the same cleanups twice.
(expand_expr, case TARGET_EXPR): Don't try to add the cleanup if
ignore's non-zero, since we would have already done it.
From-SVN: r6155
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/expr.c | 49 |
1 files changed, 24 insertions, 25 deletions
@@ -4602,7 +4602,9 @@ expand_expr (exp, target, tmode, modifier) if (RTL_EXPR_RTL (exp) == 0) { RTL_EXPR_RTL (exp) - = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier); + = expand_expr (TREE_OPERAND (exp, 0), + target ? target : const0_rtx, + tmode, modifier); cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), cleanups_this_call); /* That's it for this cleanup. */ @@ -5611,29 +5613,23 @@ expand_expr (exp, target, tmode, modifier) DECL_RTL (slot) = target; } -#if 0 - /* I bet this needs to be done, and I bet that it needs to - be above, inside the else clause. The reason is - simple, how else is it going to get cleaned up? (mrs) - - The reason is probably did not work before, and was - commented out is because this was re-expanding already - expanded target_exprs (target == 0 and DECL_RTL (slot) - != 0) also cleaning them up many times as well. :-( */ - - /* Since SLOT is not known to the called function - to belong to its stack frame, we must build an explicit - cleanup. This case occurs when we must build up a reference - to pass the reference as an argument. In this case, - it is very likely that such a reference need not be - built here. */ - - if (TREE_OPERAND (exp, 2) == 0) - TREE_OPERAND (exp, 2) = maybe_build_cleanup (slot); - if (TREE_OPERAND (exp, 2)) - cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), - cleanups_this_call); -#endif + /* We set IGNORE when we know that we're already + doing this for a cleanup. */ + if (ignore == 0) + { + /* Since SLOT is not known to the called function + to belong to its stack frame, we must build an explicit + cleanup. This case occurs when we must build up a reference + to pass the reference as an argument. In this case, + it is very likely that such a reference need not be + built here. */ + + if (TREE_OPERAND (exp, 2) == 0) + TREE_OPERAND (exp, 2) = maybe_build_cleanup (slot); + if (TREE_OPERAND (exp, 2)) + cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), + cleanups_this_call); + } } else { @@ -5771,7 +5767,10 @@ expand_expr (exp, target, tmode, modifier) } else { - op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, + /* We make sure to pass const0_rtx down if we came in with + ignore set, to avoid doing the cleanups twice for something. */ + op0 = expand_expr (TREE_OPERAND (exp, 0), + ignore ? const0_rtx : NULL_RTX, VOIDmode, (modifier == EXPAND_INITIALIZER ? modifier : EXPAND_CONST_ADDRESS)); |