Commit 5fffc382 by J"orn Rennecke Committed by Joern Rennecke

re PR rtl-optimization/21767 (if-convert leaves invalid REG_EQUAL notes)

	PR rtl-optimization/21767
	* rtl.h (function_invariant_p): Re-add declaration.
	* reload1.c (function_invariant_p): No longer static.
	* ifcvt.c (dead_or_predicable): Remove REG_EQUAL notes that
	might have become invalid.

From-SVN: r100448
parent 8e0a600b
2005-06-01 J"orn Rennecke <joern.rennecke@st.com>
PR rtl-optimization/21767
* rtl.h (function_invariant_p): Re-add declaration.
* reload1.c (function_invariant_p): No longer static.
* ifcvt.c (dead_or_predicable): Remove REG_EQUAL notes that
might have become invalid.
2005-06-01 Jakub Jelinek <jakub@redhat.com> 2005-06-01 Jakub Jelinek <jakub@redhat.com>
PR c/21536 PR c/21536
......
...@@ -3430,12 +3430,31 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb, ...@@ -3430,12 +3430,31 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
/* Move the insns out of MERGE_BB to before the branch. */ /* Move the insns out of MERGE_BB to before the branch. */
if (head != NULL) if (head != NULL)
{ {
rtx insn;
if (end == BB_END (merge_bb)) if (end == BB_END (merge_bb))
BB_END (merge_bb) = PREV_INSN (head); BB_END (merge_bb) = PREV_INSN (head);
if (squeeze_notes (&head, &end)) if (squeeze_notes (&head, &end))
return TRUE; return TRUE;
/* PR 21767: When moving insns above a conditional branch, REG_EQUAL
notes might become invalid. */
insn = head;
do
{
rtx note, set;
if (! INSN_P (insn))
continue;
note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
if (! note)
continue;
set = single_set (insn);
if (!set || !function_invariant_p (SET_SRC (set)))
remove_note (insn, note);
} while (insn != end && (insn = NEXT_INSN (insn)));
reorder_insns (head, end, PREV_INSN (earliest)); reorder_insns (head, end, PREV_INSN (earliest));
} }
......
...@@ -405,7 +405,6 @@ static int reload_reg_free_for_value_p (int, int, int, enum reload_type, ...@@ -405,7 +405,6 @@ static int reload_reg_free_for_value_p (int, int, int, enum reload_type,
rtx, rtx, int, int); rtx, rtx, int, int);
static int free_for_value_p (int, enum machine_mode, int, enum reload_type, static int free_for_value_p (int, enum machine_mode, int, enum reload_type,
rtx, rtx, int, int); rtx, rtx, int, int);
static int function_invariant_p (rtx);
static int reload_reg_reaches_end_p (unsigned int, int, enum reload_type); static int reload_reg_reaches_end_p (unsigned int, int, enum reload_type);
static int allocate_reload_reg (struct insn_chain *, int, int); static int allocate_reload_reg (struct insn_chain *, int, int);
static int conflicts_with_override (rtx); static int conflicts_with_override (rtx);
...@@ -4984,7 +4983,7 @@ free_for_value_p (int regno, enum machine_mode mode, int opnum, ...@@ -4984,7 +4983,7 @@ free_for_value_p (int regno, enum machine_mode mode, int opnum,
pic_offset_table_rtx is not, and we must not spill these things to pic_offset_table_rtx is not, and we must not spill these things to
memory. */ memory. */
static int int
function_invariant_p (rtx x) function_invariant_p (rtx x)
{ {
if (CONSTANT_P (x)) if (CONSTANT_P (x))
......
...@@ -2062,6 +2062,9 @@ extern void dbr_schedule (rtx, FILE *); ...@@ -2062,6 +2062,9 @@ extern void dbr_schedule (rtx, FILE *);
extern void dump_local_alloc (FILE *); extern void dump_local_alloc (FILE *);
extern int local_alloc (void); extern int local_alloc (void);
/* In reload1.c */
extern int function_invariant_p (rtx);
/* In reg-stack.c */ /* In reg-stack.c */
extern bool reg_to_stack (FILE *); extern bool reg_to_stack (FILE *);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment