]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/35314 (ICE with __builtin_setjmp and -fmudflap)
authorJakub Jelinek <jakub@redhat.com>
Mon, 10 Nov 2008 13:48:06 +0000 (14:48 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 10 Nov 2008 13:48:06 +0000 (14:48 +0100)
PR middle-end/35314
* tree-mudflap.c (mf_build_check_statement_for): Split then_block
after __mf_check call if the call must end a bb.

* testsuite/libmudflap.c/pass67-frag.c: New test.

From-SVN: r141741

gcc/ChangeLog
gcc/tree-mudflap.c
libmudflap/ChangeLog
libmudflap/testsuite/libmudflap.c/pass67-frag.c [new file with mode: 0644]

index 62f857f4aa6fa512f54973b9be37652ea96f9a01..d3ad211876a7e5f115e13972ada6c732d19078d5 100644 (file)
@@ -1,3 +1,9 @@
+2008-11-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/35314
+       * tree-mudflap.c (mf_build_check_statement_for): Split then_block
+       after __mf_check call if the call must end a bb.
+
 2008-11-10  Ralph Loader  <suckfish@ihug.co.nz>
 
        PR middle-end/37807
index 0b3eba5ddad63687555230b027efa70c76260219..831fcc1791a83cf10ae67aba58354c926a1bbe0d 100644 (file)
@@ -669,6 +669,15 @@ mf_build_check_statement_for (tree base, tree limit,
 
   if (! flag_mudflap_threads)
     {
+      if (stmt_ends_bb_p (g))
+       {
+         gsi = gsi_start_bb (then_bb);
+         gsi_insert_seq_after (&gsi, seq, GSI_CONTINUE_LINKING);
+         e = split_block (then_bb, g);
+         then_bb = e->dest;
+         seq = gimple_seq_alloc ();
+       }
+
       g = gimple_build_assign (mf_cache_shift_decl_l, mf_cache_shift_decl);
       gimple_seq_add_stmt (&seq, g);
 
index 9214759b304cc86c2afee206ebc324eb62454e67..208ab8fb99b90361b696922b287b78ab13ed637a 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/35314
+       * testsuite/libmudflap.c/pass67-frag.c: New test.
+
 2008-10-09  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/37568
diff --git a/libmudflap/testsuite/libmudflap.c/pass67-frag.c b/libmudflap/testsuite/libmudflap.c/pass67-frag.c
new file mode 100644 (file)
index 0000000..0c2f81a
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR middle-end/35314 */
+/* { dg-do compile } */
+/* { dg-options "-fmudflap" } */
+
+#include <setjmp.h>
+
+jmp_buf buf;
+
+void
+foo (volatile char *p)
+{
+  if (__builtin_setjmp (buf))
+    *p;
+}