From a5dbd798f2a0f2cac3517c7a38e41f1dedeae9be Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Wed, 28 Jul 1993 15:34:22 -0400 Subject: [PATCH] (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 --- gcc/c-iterate.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/c-iterate.c b/gcc/c-iterate.c index 38c15a237f9..99f9a794d2a 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 (); -- 2.30.2