Commit 963d4411 by Richard Henderson Committed by Richard Henderson

flow.c (new_insn_dead_notes): Use sets_reg_or_subreg not mark_set_resources.

        * flow.c (new_insn_dead_notes): Use sets_reg_or_subreg not
        mark_set_resources.

From-SVN: r28990
parent 2e419d09
Mon Aug 30 16:07:49 1999 Richard Henderson <rth@cygnus.com>
* flow.c (new_insn_dead_notes): Use sets_reg_or_subreg not
mark_set_resources.
Mon Aug 30 16:36:33 1999 Jeffrey A Law (law@cygnus.com) Mon Aug 30 16:36:33 1999 Jeffrey A Law (law@cygnus.com)
* invoke.texi: Fix typo. * invoke.texi: Fix typo.
......
...@@ -132,7 +132,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -132,7 +132,6 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h" #include "toplev.h"
#include "recog.h" #include "recog.h"
#include "insn-flags.h" #include "insn-flags.h"
#include "resource.h"
#include "obstack.h" #include "obstack.h"
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
...@@ -5371,6 +5370,7 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn) ...@@ -5371,6 +5370,7 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn)
if (tem == orig_last_insn) if (tem == orig_last_insn)
break; break;
} }
/* So it's a new register, presumably only used within this /* So it's a new register, presumably only used within this
group of insns. Find the last insn in the set of new insns group of insns. Find the last insn in the set of new insns
that DEST is referenced in, and add a dead note to it. */ that DEST is referenced in, and add a dead note to it. */
...@@ -5393,17 +5393,13 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn) ...@@ -5393,17 +5393,13 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn)
} }
else else
{ {
struct resources res;
rtx curr; rtx curr;
int got_set = 0;
CLEAR_RESOURCE (&res); for (curr = orig_first_insn; curr; curr = NEXT_INSN (curr))
for (curr = orig_first_insn;
curr != NULL_RTX;
curr = NEXT_INSN (curr))
{ {
if (GET_RTX_CLASS (GET_CODE (curr)) == 'i') got_set = sets_reg_or_subreg (curr, dest);
mark_set_resources (PATTERN (curr), &res, 0, 0); if (got_set)
if (TEST_HARD_REG_BIT (res.regs, REGNO (dest)))
break; break;
if (curr == orig_last_insn) if (curr == orig_last_insn)
break; break;
...@@ -5411,7 +5407,7 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn) ...@@ -5411,7 +5407,7 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn)
/* In case reg was not used later, it is dead store. /* In case reg was not used later, it is dead store.
add REG_UNUSED note. */ add REG_UNUSED note. */
if (! TEST_HARD_REG_BIT (res.regs, REGNO (dest))) if (! got_set)
{ {
rtx note = rtx_alloc (EXPR_LIST); rtx note = rtx_alloc (EXPR_LIST);
PUT_REG_NOTE_KIND (note, REG_UNUSED); PUT_REG_NOTE_KIND (note, REG_UNUSED);
...@@ -5422,9 +5418,11 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn) ...@@ -5422,9 +5418,11 @@ new_insn_dead_notes (pat, insn, first, last, orig_first_insn, orig_last_insn)
} }
} }
} }
if (insn != first) if (insn != first)
{ {
rtx set = single_set (insn); rtx set = single_set (insn);
/* If this is a set, scan backwards for a previous /* If this is a set, scan backwards for a previous
reference, and attach a REG_DEAD note to it. But we don't reference, and attach a REG_DEAD note to it. But we don't
want to do it if the insn is both using and setting the want to do it if the insn is both using and setting the
......
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