If RTL checking is enabled, make sure that emit_insn is not used to emit a
authorNick Clifton <nickc@cygnus.com>
Fri, 14 Jan 2000 20:51:04 +0000 (20:51 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Fri, 14 Jan 2000 20:51:04 +0000 (20:51 +0000)
jump insn.

From-SVN: r31420

gcc/ChangeLog
gcc/emit-rtl.c
gcc/jump.c

index fecb80c27b8ed17da5c81c4af4081c112efdb205..6be4d2cde9bf110e94ba228360223f47b8f9e3e7 100644 (file)
@@ -1,3 +1,11 @@
+2000-01-14  Nick Clifton  <nickc@cygnus.com>
+
+       * emit-rtl.c (emit_insn): If checking is enabled, make sure
+       that this function has not been used to emit a jump
+       instruction.
+
+       * jump.c (return_jump_1): Cope with being passed a null rtx.
+
 2000-01-14  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * eh-common.h: PROTO -> PARAMS.
index 304e6d43f9397dec2c88a2782c0da0e3ba098456..3ade3c64c47731010b45a9c540a999bf409faf30 100644 (file)
@@ -2948,6 +2948,17 @@ emit_insn (pattern)
       add_insn (insn);
     }
 
+#ifdef ENABLE_RTL_CHECKING
+  if (insn
+      && (returnjump_p (insn)
+         || (GET_CODE (insn) == SET
+             && SET_DEST (insn) == pc_rtx)))
+    {
+      warning ("ICE: emit_insn used where emit_jump_insn needed:\n");
+      debug_rtx (insn);
+    }
+#endif
+      
   return insn;
 }
 
index 1e9377124d54857c9cce841594b33e39fbfb2638..2edd923d670a7d7cfbd74124d6ab7b01f6a48c92 100644 (file)
@@ -3757,7 +3757,7 @@ returnjump_p_1 (loc, data)
      void *data ATTRIBUTE_UNUSED;
 {
   rtx x = *loc;
-  return GET_CODE (x) == RETURN;
+  return x && GET_CODE (x) == RETURN;
 }
 
 int