aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@multimania.com>2002-07-17 18:00:35 +0000
committerRichard Henderson <rth@gcc.gnu.org>2002-07-17 11:00:35 -0700
commitf1a73cfecf88d38c1c917c93b60cb8b2e4d82960 (patch)
tree350a578d0f7c7d1813548df578d08e605c0b1894 /gcc/loop.c
parent90888283784269660b9143890d880642fd5becbf (diff)
downloadgcc-f1a73cfecf88d38c1c917c93b60cb8b2e4d82960.zip
gcc-f1a73cfecf88d38c1c917c93b60cb8b2e4d82960.tar.gz
gcc-f1a73cfecf88d38c1c917c93b60cb8b2e4d82960.tar.bz2
re PR rtl-optimization/6713 (Regression wrt 3.0.4: g++ -O2 leads to seg fault at run time)
PR optimization/6713 * loop.c (loop_givs_rescan): Explicitly delete the insn that sets a non-replaceable giv after issuing the new one. Co-Authored-By: Glen Nakamura <glen@imodulo.com> From-SVN: r55539
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index dc64b5c..5966324 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -4874,10 +4874,20 @@ loop_givs_rescan (loop, bl, reg_map)
}
else
{
+ rtx original_insn = v->insn;
+
/* Not replaceable; emit an insn to set the original giv reg from
the reduced giv, same as above. */
- loop_insn_emit_after (loop, 0, v->insn,
- gen_move_insn (v->dest_reg, v->new_reg));
+ v->insn = loop_insn_emit_after (loop, 0, original_insn,
+ gen_move_insn (v->dest_reg,
+ v->new_reg));
+
+ /* The original insn may have a REG_EQUAL note. This note is
+ now incorrect and may result in invalid substitutions later.
+ We could just delete the note, but we know that the entire
+ insn is dead, so we might as well save ourselves the bother
+ and remove the whole thing. */
+ delete_insn (original_insn);
}
/* When a loop is reversed, givs which depend on the reversed