aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-11-16 22:13:52 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-11-16 22:13:52 +0000
commit885c9b5d3a53c531fca622b4a3b0ef03df92daed (patch)
treed3ce62c6785fad984002bec2dbfc693e299f8950 /gcc/rtlanal.c
parent2b12962772d3b0e85d860609f32bfb28515d5ba9 (diff)
downloadgcc-885c9b5d3a53c531fca622b4a3b0ef03df92daed.zip
gcc-885c9b5d3a53c531fca622b4a3b0ef03df92daed.tar.gz
gcc-885c9b5d3a53c531fca622b4a3b0ef03df92daed.tar.bz2
re PR rtl-optimization/46315 (-O2 -fno-strict-overflow causes wrong code generation)
PR rtl-optimization/46315 * rtl.h (remove_reg_equal_equiv_notes_for_regno): Declare. * rtlanal.c (remove_reg_equal_equiv_notes_for_regno): New function extracted from... * dce.c (delete_corresponding_reg_eq_notes): ...here. Rename into... (remove_reg_equal_equiv_notes_for_defs): ...this. (delete_unmarked_insns): Adjust to above renaming. * ifcvt.c (dead_or_predicable): Remove REG_EQUAL and REG_EQUIV notes referring to registers set in the insns being moved, if any. * df-core.c (df_ref_dump): New function extracted from... (df_refs_chain_dump): ...here. Call it. (df_regs_chain_dump): Likewise. * df-problems.c (df_chain_dump): Print 'e' for uses in notes. * df-scan.c (df_scan_start_dump): Likewise. Fix long line. From-SVN: r166827
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 930828a..eb4d3ab 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1941,6 +1941,33 @@ remove_reg_equal_equiv_notes (rtx insn)
}
}
+/* Remove all REG_EQUAL and REG_EQUIV notes referring to REGNO. */
+
+void
+remove_reg_equal_equiv_notes_for_regno (unsigned int regno)
+{
+ df_ref eq_use;
+
+ if (!df)
+ return;
+
+ /* This loop is a little tricky. We cannot just go down the chain because
+ it is being modified by some actions in the loop. So we just iterate
+ over the head. We plan to drain the list anyway. */
+ while ((eq_use = DF_REG_EQ_USE_CHAIN (regno)) != NULL)
+ {
+ rtx insn = DF_REF_INSN (eq_use);
+ rtx note = find_reg_equal_equiv_note (insn);
+
+ /* This assert is generally triggered when someone deletes a REG_EQUAL
+ or REG_EQUIV note by hacking the list manually rather than calling
+ remove_note. */
+ gcc_assert (note);
+
+ remove_note (insn, note);
+ }
+}
+
/* Search LISTP (an EXPR_LIST) for an entry whose first operand is NODE and
return 1 if it is found. A simple equality test is used to determine if
NODE matches. */