aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-01-09 19:55:13 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2004-01-09 19:55:13 +0000
commit0fab64a344486770d0acc827ab6b670543d58a15 (patch)
treee2935a8f65ac880227cefaf160bb48b5a018326f /gcc/stmt.c
parent2fca049fe8aada42f982aff9498eb45d3a2db302 (diff)
downloadgcc-0fab64a344486770d0acc827ab6b670543d58a15.zip
gcc-0fab64a344486770d0acc827ab6b670543d58a15.tar.gz
gcc-0fab64a344486770d0acc827ab6b670543d58a15.tar.bz2
expr.h (expand_expr): Make it a macro, not a function.
* expr.h (expand_expr): Make it a macro, not a function. (expand_expr_real): New function. * expr.c (store_expr): Adjust logic for deciding whether or not to copy the value returned by expand_expr. (expand_expr): Rename to ... (expand_expr_real): ... this. Add alt_rtl parameter. Adjust calls to language hooks. * c-common.h (c_expand_expr): Adjust prototype. * c-common.c (c_expand_expr): Add alt_rtl parameter. * langhooks-def.h (lhd_expand_expr): Change prototype. * langhooks.c (lhd_expand_expr): Add all_rtl parameter. * langhooks.h (lang_hooks): Change type of expand_expr. * stmt.c (stmt_status): Add x_last_expr_alt_rtl. (last_expr_alt_rtl): Likewise. (expand_expr_stmt_value): Set last_expr_alt_rtl. (clear_last_expr): Clear it. (expand_end_stmt_expr): Set RTL_EXPR_ATL_RTL. (expand_end_bindings): Save and restor last_expr_alt_rtl. * tree.def (RTL_EXPR): Give it an additional operand. * tree.h (RTL_EXPR_ALT_RTL): New macro. * misc.c (gnat_expand_expr): Add alt_rtl parameter. * cp-tree.h (cxx_expand_expr): Change prototype. * expr.c (cxx_expand_expr): Add alt_rtl parameter. * java-tree.h (java_expand_expr): Change prototype. * expr.c (java_expand_expr): Add alt_rtl parameter. From-SVN: r75594
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 7b388dd..1a3d918 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -361,6 +361,7 @@ struct stmt_status GTY(())
record the expr's type and its RTL value here. */
tree x_last_expr_type;
rtx x_last_expr_value;
+ rtx x_last_expr_alt_rtl;
/* Nonzero if within a ({...}) grouping, in which case we must
always compute a value for each expr-stmt in case it is the last one. */
@@ -383,6 +384,7 @@ struct stmt_status GTY(())
#define current_block_start_count (cfun->stmt->x_block_start_count)
#define last_expr_type (cfun->stmt->x_last_expr_type)
#define last_expr_value (cfun->stmt->x_last_expr_value)
+#define last_expr_alt_rtl (cfun->stmt->x_last_expr_alt_rtl)
#define expr_stmts_for_value (cfun->stmt->x_expr_stmts_for_value)
#define emit_locus (cfun->stmt->x_emit_locus)
#define goto_fixup_chain (cfun->stmt->x_goto_fixup_chain)
@@ -2140,6 +2142,7 @@ expand_expr_stmt_value (tree exp, int want_value, int maybe_last)
{
rtx value;
tree type;
+ rtx alt_rtl = NULL;
if (want_value == -1)
want_value = expr_stmts_for_value != 0;
@@ -2166,8 +2169,8 @@ expand_expr_stmt_value (tree exp, int want_value, int maybe_last)
/* The call to `expand_expr' could cause last_expr_type and
last_expr_value to get reset. Therefore, we set last_expr_value
and last_expr_type *after* calling expand_expr. */
- value = expand_expr (exp, want_value ? NULL_RTX : const0_rtx,
- VOIDmode, 0);
+ value = expand_expr_real (exp, want_value ? NULL_RTX : const0_rtx,
+ VOIDmode, 0, &alt_rtl);
type = TREE_TYPE (exp);
/* If all we do is reference a volatile value in memory,
@@ -2203,6 +2206,7 @@ expand_expr_stmt_value (tree exp, int want_value, int maybe_last)
if (want_value)
{
last_expr_value = value;
+ last_expr_alt_rtl = alt_rtl;
last_expr_type = type;
}
@@ -2322,6 +2326,7 @@ clear_last_expr (void)
{
last_expr_type = NULL_TREE;
last_expr_value = NULL_RTX;
+ last_expr_alt_rtl = NULL_RTX;
}
/* Begin a statement-expression, i.e., a series of statements which
@@ -2369,6 +2374,7 @@ expand_end_stmt_expr (tree t)
if (! last_expr_value || ! last_expr_type)
{
last_expr_value = const0_rtx;
+ last_expr_alt_rtl = NULL_RTX;
last_expr_type = void_type_node;
}
else if (GET_CODE (last_expr_value) != REG && ! CONSTANT_P (last_expr_value))
@@ -2379,6 +2385,7 @@ expand_end_stmt_expr (tree t)
TREE_TYPE (t) = last_expr_type;
RTL_EXPR_RTL (t) = last_expr_value;
+ RTL_EXPR_ALT_RTL (t) = last_expr_alt_rtl;
RTL_EXPR_SEQUENCE (t) = get_insns ();
rtl_expr_chain = tree_cons (NULL_TREE, t, rtl_expr_chain);
@@ -3801,6 +3808,7 @@ expand_end_bindings (tree vars, int mark_ends, int dont_jump_in)
/* Don't let cleanups affect ({...}) constructs. */
int old_expr_stmts_for_value = expr_stmts_for_value;
rtx old_last_expr_value = last_expr_value;
+ rtx old_last_expr_alt_rtl = last_expr_alt_rtl;
tree old_last_expr_type = last_expr_type;
expr_stmts_for_value = 0;
@@ -3817,6 +3825,7 @@ expand_end_bindings (tree vars, int mark_ends, int dont_jump_in)
expr_stmts_for_value = old_expr_stmts_for_value;
last_expr_value = old_last_expr_value;
+ last_expr_alt_rtl = old_last_expr_alt_rtl;
last_expr_type = old_last_expr_type;
/* Restore the stack level. */