aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-04-28 13:13:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-04-28 13:13:50 +0000
commit6c6aa8e6ca95c9415d21359e606bc0bba1b87846 (patch)
tree59b0cb6e75de78a045e75871a70cf34ee1e2625d /gcc
parent9540b3c316d16dd49bc890937b4974f51dfa33a7 (diff)
downloadgcc-6c6aa8e6ca95c9415d21359e606bc0bba1b87846.zip
gcc-6c6aa8e6ca95c9415d21359e606bc0bba1b87846.tar.gz
gcc-6c6aa8e6ca95c9415d21359e606bc0bba1b87846.tar.bz2
re PR tree-optimization/60979 (ICE: in gimple_redirect_edge_and_branch_force, at tree-cfg.c:5544, w/ -O -ftree-loop-linear or -fgraphite-identity)
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. * gcc.dg/graphite/pr60979.c: New testcase. From-SVN: r209859
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/graphite-scop-detection.c6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr60979.c37
4 files changed, 53 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5c571d1..61fd558 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
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.
* passes.c (pass_manager::execute_early_local_passes):
Adjust.
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 821f084..635e21a 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 71af467..df5af3a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..0004a51
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr60979.c
@@ -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);
+}