aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>2004-09-01 22:28:39 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2004-09-01 20:28:39 +0000
commitd7fe1183215b7a04b62839775c775e6c4a5c90e1 (patch)
treec06fe73702cc358a9c7856a21cfb57fab47331bf
parent57b38f517c7f434809f5ceb5be1e3bf4c0055bf9 (diff)
downloadgcc-d7fe1183215b7a04b62839775c775e6c4a5c90e1.zip
gcc-d7fe1183215b7a04b62839775c775e6c4a5c90e1.tar.gz
gcc-d7fe1183215b7a04b62839775c775e6c4a5c90e1.tar.bz2
re PR rtl-optimization/16408 (internal compiler error: in delete_insn, at cfgrtl.c:146)
PR rtl-optimization/16408 * gcse.c (replace_store_insn): Fix LIBCALL/RETVAL notes. From-SVN: r86928
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gcse.c22
2 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 220d75d..e091271 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR rtl-optimization/16408
+ * gcse.c (replace_store_insn): Fix LIBCALL/RETVAL notes.
+
2004-09-01 Richard Henderson <rth@redhat.com>
* config/ns32k/ns32k.h (TRANSFER_FROM_TRAMPOLINE): Remove.
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 16d76fe..3d97964 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -6321,7 +6321,7 @@ remove_reachable_equiv_notes (basic_block bb, struct ls_expr *smexpr)
static void
replace_store_insn (rtx reg, rtx del, basic_block bb, struct ls_expr *smexpr)
{
- rtx insn, mem, note, set, ptr;
+ rtx insn, mem, note, set, ptr, pair;
mem = smexpr->pattern;
insn = gen_move_insn (reg, SET_SRC (single_set (del)));
@@ -6343,6 +6343,26 @@ replace_store_insn (rtx reg, rtx del, basic_block bb, struct ls_expr *smexpr)
XEXP (ptr, 0) = insn;
break;
}
+
+ /* Move the notes from the deleted insn to its replacement, and patch
+ up the LIBCALL notes. */
+ REG_NOTES (insn) = REG_NOTES (del);
+
+ note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
+ if (note)
+ {
+ pair = XEXP (note, 0);
+ note = find_reg_note (pair, REG_LIBCALL, NULL_RTX);
+ XEXP (note, 0) = insn;
+ }
+ note = find_reg_note (insn, REG_LIBCALL, NULL_RTX);
+ if (note)
+ {
+ pair = XEXP (note, 0);
+ note = find_reg_note (pair, REG_RETVAL, NULL_RTX);
+ XEXP (note, 0) = insn;
+ }
+
delete_insn (del);
/* Now we must handle REG_EQUAL notes whose contents is equal to the mem;