summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-19 06:26:21 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-19 06:26:21 +0000
commit0319266583b672ebd96fa20763565ef167bfc35d (patch)
tree902804b9e4bd40a0c8043ddf341af0b4f0981e9c /gcc/expr.c
parent70512b9393cc071f7b3d442da7098b909844e116 (diff)
downloadgcc-0319266583b672ebd96fa20763565ef167bfc35d.tar.gz
2004-05-19 Steven Bosscher <stevenb@suse.de>
Expanders cleanups after tree-ssa merge, part 1. * expr.c (store_constructor): Build loop start and end by hand instead of via loop functions from stmt.c. (expand_expr_real_1): Abort if we see an EXIT_EXPR or a LOOP_EXPR. Remove the code to expand them. * stmt.c (loop_stack): Remove this and everything related. (struct nesting, enum nesting_desc): Update. (expand_fixup): Likewise. (expand_loop_start, expand_start_loop_continue_elsewhere, expand_start_null_loop, expand_loop_continue_here, expand_end_loop, expand_end_null_loop, expand_continue_loop, expand_exit_loop, expand_exit_loop_if_false, expand_exit_loop_top_cond, expand_exit_something): Remove. * tree.h: Remove prototypes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82018 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 1f8c3ef70d4..dd0725811ed 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4963,8 +4963,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{
tree lo_index = TREE_OPERAND (index, 0);
tree hi_index = TREE_OPERAND (index, 1);
- rtx index_r, pos_rtx, loop_end;
- struct nesting *loop;
+ rtx index_r, pos_rtx;
HOST_WIDE_INT lo, hi, count;
tree position;
@@ -5005,9 +5004,11 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
}
else
{
- expand_expr (hi_index, NULL_RTX, VOIDmode, 0);
- loop_end = gen_label_rtx ();
+ rtx loop_start = gen_label_rtx ();
+ rtx loop_end = gen_label_rtx ();
+ tree exit_cond;
+ expand_expr (hi_index, NULL_RTX, VOIDmode, 0);
unsignedp = TYPE_UNSIGNED (domain);
index = build_decl (VAR_DECL, NULL_TREE, domain);
@@ -5025,7 +5026,11 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
emit_queue ();
}
store_expr (lo_index, index_r, 0);
- loop = expand_start_loop (0);
+
+ /* Build the head of the loop. */
+ do_pending_stack_adjust ();
+ emit_queue ();
+ emit_label (loop_start);
/* Assign value to element index. */
position
@@ -5046,14 +5051,19 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
else
store_expr (value, xtarget, 0);
- expand_exit_loop_if_false (loop,
- build (LT_EXPR, integer_type_node,
- index, hi_index));
+ /* Generate a conditional jump to exit the loop. */
+ exit_cond = build (LT_EXPR, integer_type_node,
+ index, hi_index);
+ jumpif (exit_cond, loop_end);
+ /* Update the loop counter, and jump to the head of
+ the loop. */
expand_increment (build (PREINCREMENT_EXPR,
TREE_TYPE (index),
index, integer_one_node), 0, 0);
- expand_end_loop ();
+ emit_jump (loop_start);
+
+ /* Build the end of the loop. */
emit_label (loop_end);
}
}
@@ -6804,10 +6814,11 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
expand_computed_goto (TREE_OPERAND (exp, 0));
return const0_rtx;
+ /* These are lowered during gimplification, so we should never ever
+ see them here. */
+ case LOOP_EXPR:
case EXIT_EXPR:
- expand_exit_loop_if_false (NULL,
- invert_truthvalue (TREE_OPERAND (exp, 0)));
- return const0_rtx;
+ abort ();
case LABELED_BLOCK_EXPR:
if (LABELED_BLOCK_BODY (exp))
@@ -6823,15 +6834,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
expand_goto (LABELED_BLOCK_LABEL (EXIT_BLOCK_LABELED_BLOCK (exp)));
return const0_rtx;
- case LOOP_EXPR:
- push_temp_slots ();
- expand_start_loop (1);
- expand_expr_stmt_value (TREE_OPERAND (exp, 0), 0, 1);
- expand_end_loop ();
- pop_temp_slots ();
-
- return const0_rtx;
-
case BIND_EXPR:
{
tree block = BIND_EXPR_BLOCK (exp);