summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-14 20:51:04 +0000
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-14 20:51:04 +0000
commit8386a92abc77788a501a23c67853ab5f95437357 (patch)
tree5ab565af0b5e42f047abbefe081697352492687d /gcc
parent621f6678bd276a87e8bf36b04c507b19ef1e0c49 (diff)
downloadgcc-8386a92abc77788a501a23c67853ab5f95437357.tar.gz
If RTL checking is enabled, make sure that emit_insn is not used to emit a
jump insn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31420 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/emit-rtl.c11
-rw-r--r--gcc/jump.c2
3 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fecb80c27b8..6be4d2cde9b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 304e6d43f93..3ade3c64c47 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -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;
}
diff --git a/gcc/jump.c b/gcc/jump.c
index 1e9377124d5..2edd923d670 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -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