diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cfbcf96e95b432f8ac47c65f7f28ed4889e679dc..b2601b768caaa834068de599f41db6e17b0f8cdf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+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. 
diff --git a/gcc/rtl.h b/gcc/rtl.h
index c873d9f6bd2055d002bd56cd0cd11d4211963824..3cab166f527ed9a618c20ea226867b65087bf702 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -174,8 +174,9 @@ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"),
      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'.
@@ -578,7 +579,7 @@ do {				\
 /* 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
diff --git a/gcc/ssa-dce.c b/gcc/ssa-dce.c
index 3584ca2ebc8728d45f172c0b4936e8c46f42569b..6ccc222cea669e84678747eb8b387a8fd49bb035 100644
--- a/gcc/ssa-dce.c
+++ b/gcc/ssa-dce.c
@@ -135,10 +135,12 @@ static void mark_all_insn_unnecessary
   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));
@@ -448,8 +450,11 @@ static void
 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.  */
@@ -522,7 +527,7 @@ ssa_eliminate_dead_code ()
 
   /* 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);
@@ -725,8 +730,11 @@ ssa_eliminate_dead_code ()
 	}
     }
   /* 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);