aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-iterate.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-07-28 15:34:22 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-07-28 15:34:22 -0400
commita5dbd798f2a0f2cac3517c7a38e41f1dedeae9be (patch)
treec34d8b1fc4b797f04aa41efe29e6d06a483cedc3 /gcc/c-iterate.c
parentc49f1ce85dce7d834bac3f80b0402878104c252f (diff)
downloadgcc-a5dbd798f2a0f2cac3517c7a38e41f1dedeae9be.zip
gcc-a5dbd798f2a0f2cac3517c7a38e41f1dedeae9be.tar.gz
gcc-a5dbd798f2a0f2cac3517c7a38e41f1dedeae9be.tar.bz2
(iterator_loop_{pro,epi}logue): Set TREE_SIDE_EFFECTS on the MODIFY_EXPRs we make.
(iterator_loop_{pro,epi}logue): Set TREE_SIDE_EFFECTS on the MODIFY_EXPRs we make. Pass const0_rtx as TARGET to expand_expr. From-SVN: r5032
Diffstat (limited to 'gcc/c-iterate.c')
-rw-r--r--gcc/c-iterate.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/c-iterate.c b/gcc/c-iterate.c
index 38c15a2..99f9a79 100644
--- a/gcc/c-iterate.c
+++ b/gcc/c-iterate.c
@@ -278,19 +278,22 @@ iterator_loop_prologue (idecl, start_note, end_note)
tree idecl;
rtx *start_note, *end_note;
{
+ tree expr;
+
/* Force the save_expr in DECL_INITIAL to be calculated
if it hasn't been calculated yet. */
- expand_expr (DECL_INITIAL (idecl), 0, VOIDmode, 0);
+ expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode, 0);
if (DECL_RTL (idecl) == 0)
expand_decl (idecl);
if (start_note)
*start_note = emit_note (0, NOTE_INSN_DELETED);
+
/* Initialize counter. */
- expand_expr (build (MODIFY_EXPR, TREE_TYPE (idecl),
- idecl, integer_zero_node),
- 0, VOIDmode, 0);
+ expr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, integer_zero_node);
+ TREE_SIDE_EFFECTS (expr) = 1;
+ expand_expr (expr, const0_rtx, VOIDmode, 0);
expand_start_loop_continue_elsewhere (1);
@@ -329,8 +332,9 @@ iterator_loop_epilogue (idecl, start_note, end_note)
*start_note = emit_note (0, NOTE_INSN_DELETED);
expand_loop_continue_here ();
incr = build_binary_op (PLUS_EXPR, idecl, integer_one_node, 0);
- expand_expr (build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, incr),
- 0, VOIDmode, 0);
+ incr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, incr);
+ TREE_SIDE_EFFECTS (incr) = 1;
+ expand_expr (incr, const0_rtx, VOIDmode, 0);
test = build_binary_op (LT_EXPR, idecl, DECL_INITIAL (idecl), 0);
expand_exit_loop_if_false (0, test);
expand_end_loop ();