summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-17 19:27:35 +0000
committerdaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-17 19:27:35 +0000
commit326fb3fd5d032dbf896558a1718ca1a0f6a23523 (patch)
tree0ee9c88e716310a821d02281dcf3c8aa315aa9b9
parent3461df79786575e42f992aac9c711c464b7ca1aa (diff)
downloadgcc-326fb3fd5d032dbf896558a1718ca1a0f6a23523.tar.gz
2009-06-17 David Daney <ddaney@caviumnetworks.com>
* jump.c (cleanup_barriers): Handle case of no insns before a barrier. 2009-06-17 David Daney <ddaney@caviumnetworks.com> * gcc.dg/builtin-unreachable-3.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148624 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/jump.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/builtin-unreachable-3.c9
4 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1a5a9a637b6..9776a81048f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-17 David Daney <ddaney@caviumnetworks.com>
+
+ * jump.c (cleanup_barriers): Handle case of no insns before a
+ barrier.
+
2009-06-17 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/dfp.md (nabsdd2_fpr): Correct mode.
diff --git a/gcc/jump.c b/gcc/jump.c
index 350de16f07c..7fe34f18661 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -113,6 +113,8 @@ cleanup_barriers (void)
if (BARRIER_P (insn))
{
prev = prev_nonnote_insn (insn);
+ if (!prev)
+ continue;
if (BARRIER_P (prev))
delete_insn (insn);
else if (prev != PREV_INSN (insn))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 873ec275d0e..5b7b369c907 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2009-06-17 David Daney <ddaney@caviumnetworks.com>
+ * gcc.dg/builtin-unreachable-3.c: New test.
+
+2009-06-17 David Daney <ddaney@caviumnetworks.com>
+
* gcc.target/i386/builtin-unreachable.c: New test.
2009-06-17 Ian Lance Taylor <iant@google.com>
diff --git a/gcc/testsuite/gcc.dg/builtin-unreachable-3.c b/gcc/testsuite/gcc.dg/builtin-unreachable-3.c
new file mode 100644
index 00000000000..6ad69261e1d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-unreachable-3.c
@@ -0,0 +1,9 @@
+/* Check that a function containing only __builtin_unreachable()
+ doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+const char *
+f (void)
+{
+ __builtin_unreachable ();
+}