]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2014-04-28 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Apr 2014 13:13:50 +0000 (13:13 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 28 Apr 2014 13:13:50 +0000 (13:13 +0000)
PR tree-optimization/60979
* graphite-scop-detection.c (scopdet_basic_block_info): Reject
SCOPs that end in a block with a successor with abnormal
predecessors.

* gcc.dg/graphite/pr60979.c: New testcase.

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

gcc/ChangeLog
gcc/graphite-scop-detection.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/pr60979.c [new file with mode: 0644]

index 5c571d10a4344124a31d11b04ddb85efbb9d6680..61fd558d29de79ec0b6becba22c87b9a73278116 100644 (file)
@@ -1,3 +1,10 @@
+2014-04-28  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/60979
+       * graphite-scop-detection.c (scopdet_basic_block_info): Reject
+       SCOPs that end in a block with a successor with abnormal
+       predecessors.
+
 2014-04-28  Richard Biener  <rguenther@suse.de>
 
        * tree-pass.h (execute_pass_list): Adjust prototype.
index 821f0846ef2bbda19adef9badfba22d6f921a591..635e21a8519b53464edd8298fdda0d9d6f09c61c 100644 (file)
@@ -474,8 +474,10 @@ scopdet_basic_block_info (basic_block bb, loop_p outermost_loop,
       result.exits = false;
 
       /* Mark bbs terminating a SESE region difficult, if they start
-        a condition.  */
-      if (!single_succ_p (bb))
+        a condition or if the block it exits to cannot be split
+        with make_forwarder_block.  */
+      if (!single_succ_p (bb)
+         || bb_has_abnormal_pred (single_succ (bb)))
        result.difficult = true;
       else
        result.exit = single_succ (bb);
index 71af46770e5d0d6bdf33d852bab7afdbc3d73522..df5af3aae5ad497fd6d49732a2996145fe05becc 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-28  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/60979
+       * gcc.dg/graphite/pr60979.c: New testcase.
+
 2014-04-28  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR c/60983
diff --git a/gcc/testsuite/gcc.dg/graphite/pr60979.c b/gcc/testsuite/gcc.dg/graphite/pr60979.c
new file mode 100644 (file)
index 0000000..0004a51
--- /dev/null
@@ -0,0 +1,37 @@
+/* { dg-options "-O -fgraphite-identity" } */
+
+#include <setjmp.h>
+
+struct x;
+
+typedef struct x **(*a)(struct x *);
+
+struct x {
+    union {
+       struct {
+           union {
+               a *i;
+           } l;
+           int s;
+       } y;
+    } e;
+};
+
+jmp_buf c;
+
+void
+b(struct x *r)
+{
+  int f;
+  static int w = 0;
+  volatile jmp_buf m;
+  f = (*(((struct x *)r)->e.y.l.i[2]((struct x *)r)))->e.y.s;
+  if (w++ != 0)
+    __builtin_memcpy((char *)m, (const char *)c, sizeof(jmp_buf));
+  if (setjmp (c) == 0) {
+      int z;
+      for (z = 0; z < 0; ++z)
+       ;
+  }
+  d((const char *)m);
+}