+2002-12-26 Jose Renau <renau@cs.uiuc.edu>
+
+ * ssa-dce.c (EXECUTE_IF_UNNECESSARY): Verify INSN is an
+ INSN_P before checking to see if it is dead.
+ (mark_all_insn_unnecessary): Similarly.
+ (ssa_eliminate_dead_code): Similarly.
+ * rtl.h (struct rtx_def): Update comments for in_struct usage
+ in dead code elimination pass.
+ (INSN_DEAD_CODE_P): Allow JUMP_INSN and CALL_INSN as well.
+
2002-12-26 Andreas Schwab <schwab@suse.de>
* config.gcc (powerpc*-*-*, rs6000-*-*): Fix assignment syntax.
1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
from the target of a branch. Valid from reorg until end of compilation;
cleared before used.
- 1 in an INSN or related rtx if this insn is dead code. Valid only during
- dead-code elimination phase; cleared before use. */
+ 1 in an INSN, JUMP_INSN or CALL_INSN or related rtx if this insn is
+ dead code. Valid only during dead-code elimination phase; cleared
+ before use. */
unsigned int in_struct : 1;
/* At the end of RTL generation, 1 if this rtx is used. This is used for
copying shared structure. See `unshare_all_rtl'.
/* 1 if RTX is an insn that is dead code. Valid only for dead-code
elimination phase. */
#define INSN_DEAD_CODE_P(RTX) \
- (RTL_FLAG_CHECK1("INSN_DEAD_CODE_P", (RTX), INSN)->in_struct)
+ (RTL_FLAG_CHECK3("INSN_DEAD_CODE_P", (RTX), INSN, CALL_INSN, JUMP_INSN)->in_struct)
/* 1 if RTX is an insn in a delay slot and is from the target of the branch.
If the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
rtx INSN; \
\
for (INSN = get_insns (); INSN != NULL_RTX; INSN = NEXT_INSN (INSN)) \
- if (INSN_DEAD_CODE_P (INSN)) { \
- CODE; \
- } \
+ if (INSN_P (insn) && INSN_DEAD_CODE_P (INSN)) \
+ { \
+ CODE; \
+ } \
}
+
/* Find the label beginning block BB. */
static rtx find_block_label
PARAMS ((basic_block bb));
mark_all_insn_unnecessary ()
{
rtx insn;
- for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
- KILL_INSN (insn);
+ for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) {
+ if (INSN_P (insn))
+ KILL_INSN (insn);
+ }
+
}
/* Find the label beginning block BB, adding one if necessary. */
/* Find inherently necessary instructions. */
for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
- if (find_inherently_necessary (insn))
+ if (find_inherently_necessary (insn) && INSN_P (insn))
{
RESURRECT_INSN (insn);
VARRAY_PUSH_RTX (unprocessed_instructions, insn);
}
}
/* Release allocated memory. */
- for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
- RESURRECT_INSN (insn);
+ for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) {
+ if (INSN_P (insn))
+ RESURRECT_INSN (insn);
+ }
+
if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0)
abort ();
control_dependent_block_to_edge_map_free (cdbte);