Commit 6af8eb57 by Steven Bosscher Committed by Steven Bosscher

Expanders cleanups after tree-ssa merge, part 1.

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.

From-SVN: r82018
parent cc52902d
2004-05-19 Steven Bosscher <stevenb@suse.de>
* 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.
2004-05-18 Mike Stump <mrs@apple.com>
Devang Patel <dpatel@apple.com>
......
......@@ -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);
......
......@@ -3392,17 +3392,6 @@ extern void expand_start_cond (tree, int);
extern void expand_end_cond (void);
extern void expand_start_else (void);
extern void expand_start_elseif (tree);
extern struct nesting *expand_start_loop (int);
extern struct nesting *expand_start_loop_continue_elsewhere (int);
extern struct nesting *expand_start_null_loop (void);
extern void expand_loop_continue_here (void);
extern void expand_end_loop (void);
extern void expand_end_null_loop (void);
extern int expand_continue_loop (struct nesting *);
extern int expand_exit_loop (struct nesting *);
extern int expand_exit_loop_if_false (struct nesting *,tree);
extern int expand_exit_loop_top_cond (struct nesting *, tree);
extern int expand_exit_something (void);
extern void expand_stack_alloc (tree, tree);
extern rtx expand_stack_save (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment