Commit dca3da7a by Steven Bosscher

gcse.c (struct reg_use): Remove unused struct.

	* gcse.c (struct reg_use): Remove unused struct.
	(gcse_emit_move_after): Do not create REG_EQUAL notes that reference
	the SET_DEST of the instruction the note would be attached to.
	* cse.c (cse_main): Add the DF_NOTE problem.

From-SVN: r194108
parent cef1bc58
2012-12-03 Steven Bosscher <steven@gcc.gnu.org>
* gcse.c (struct reg_use): Remove unused struct.
(gcse_emit_move_after): Do not create REG_EQUAL notes that reference
the SET_DEST of the instruction the note would be attached to.
* cse.c (cse_main): Add the DF_NOTE problem.
2012-12-03 Jakub Jelinek <jakub@redhat.com> 2012-12-03 Jakub Jelinek <jakub@redhat.com>
* sanitizer.def: Add Address Sanitizer builtins. * sanitizer.def: Add Address Sanitizer builtins.
...@@ -6520,6 +6520,7 @@ cse_main (rtx f ATTRIBUTE_UNUSED, int nregs) ...@@ -6520,6 +6520,7 @@ cse_main (rtx f ATTRIBUTE_UNUSED, int nregs)
int i, n_blocks; int i, n_blocks;
df_set_flags (DF_LR_RUN_DCE); df_set_flags (DF_LR_RUN_DCE);
df_note_add_problem ();
df_analyze (); df_analyze ();
df_set_flags (DF_DEFER_INSN_RESCAN); df_set_flags (DF_DEFER_INSN_RESCAN);
......
...@@ -255,8 +255,6 @@ int flag_rerun_cse_after_global_opts; ...@@ -255,8 +255,6 @@ int flag_rerun_cse_after_global_opts;
/* An obstack for our working variables. */ /* An obstack for our working variables. */
static struct obstack gcse_obstack; static struct obstack gcse_obstack;
struct reg_use {rtx reg_rtx; };
/* Hash table of expressions. */ /* Hash table of expressions. */
struct expr struct expr
...@@ -2491,22 +2489,26 @@ gcse_emit_move_after (rtx dest, rtx src, rtx insn) ...@@ -2491,22 +2489,26 @@ gcse_emit_move_after (rtx dest, rtx src, rtx insn)
rtx new_rtx; rtx new_rtx;
rtx set = single_set (insn), set2; rtx set = single_set (insn), set2;
rtx note; rtx note;
rtx eqv; rtx eqv = NULL_RTX;
/* This should never fail since we're creating a reg->reg copy /* This should never fail since we're creating a reg->reg copy
we've verified to be valid. */ we've verified to be valid. */
new_rtx = emit_insn_after (gen_move_insn (dest, src), insn); new_rtx = emit_insn_after (gen_move_insn (dest, src), insn);
/* Note the equivalence for local CSE pass. */ /* Note the equivalence for local CSE pass. Take the note from the old
set if there was one. Otherwise record the SET_SRC from the old set
unless DEST is also an operand of the SET_SRC. */
set2 = single_set (new_rtx); set2 = single_set (new_rtx);
if (!set2 || !rtx_equal_p (SET_DEST (set2), dest)) if (!set2 || !rtx_equal_p (SET_DEST (set2), dest))
return new_rtx; return new_rtx;
if ((note = find_reg_equal_equiv_note (insn))) if ((note = find_reg_equal_equiv_note (insn)))
eqv = XEXP (note, 0); eqv = XEXP (note, 0);
else else if (! REG_P (dest)
|| ! reg_mentioned_p (dest, SET_SRC (set)))
eqv = SET_SRC (set); eqv = SET_SRC (set);
if (eqv != NULL_RTX)
set_unique_reg_note (new_rtx, REG_EQUAL, copy_insn_1 (eqv)); set_unique_reg_note (new_rtx, REG_EQUAL, copy_insn_1 (eqv));
return new_rtx; return new_rtx;
......
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