OSDN Git Service

PR middle-end/35314
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Nov 2008 13:48:06 +0000 (13:48 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Nov 2008 13:48:06 +0000 (13:48 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141741 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 62f857f..d3ad211 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 0b3eba5..831fcc1 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 9214759..208ab8f 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;
+}