aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-01-22 16:07:36 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-01-22 16:07:36 +0000
commitf4b05e74683b0fbb323606875010006ee0dc557e (patch)
tree6606604045ae104f5614d2103de2594f53f0f248
parent98321768552dffe06a24315a06df5ac18d8d0bd8 (diff)
downloadgcc-f4b05e74683b0fbb323606875010006ee0dc557e.zip
gcc-f4b05e74683b0fbb323606875010006ee0dc557e.tar.gz
gcc-f4b05e74683b0fbb323606875010006ee0dc557e.tar.bz2
re PR tree-optimization/64728 (internal compiler error: SSA corruption)
2015-01-22 Richard Biener <rguenther@suse.de> PR middle-end/64728 * tree-ssa-coalesce.c (coalesce_partitions): Do not perform abnormal coalescing on undefined SSA names. * gcc.dg/torture/pr64728.c: New testcase. From-SVN: r220003
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr64728.c27
-rw-r--r--gcc/tree-ssa-coalesce.c7
4 files changed, 44 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 82883c1..e9887c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-22 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/64728
+ * tree-ssa-coalesce.c (coalesce_partitions): Do not perform
+ abnormal coalescing on undefined SSA names.
+
2015-22-01 Uros Bizjak <ubizjak@gmail.com>
PR target/64688
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8e6dadc..8bebdac 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-22 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/64728
+ * gcc.dg/torture/pr64728.c: New testcase.
+
2015-22-01 Uros Bizjak <ubizjak@gmail.com>
PR target/64688
diff --git a/gcc/testsuite/gcc.dg/torture/pr64728.c b/gcc/testsuite/gcc.dg/torture/pr64728.c
new file mode 100644
index 0000000..65c8508
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr64728.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+#include <setjmp.h>
+
+jmp_buf a;
+int b, d;
+void baz (long);
+
+static void
+bar (long *x)
+{
+ if (d)
+ *x = b;
+}
+
+void
+foo ()
+{
+ baz (0);
+ if (setjmp (a))
+ {
+ long c;
+ bar (&c);
+ baz (c);
+ }
+ baz (0);
+}
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index fda79dc..be696fe 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -1213,8 +1213,13 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
gsi_next (&gsi))
{
gphi *phi = gsi.phi ();
+ tree arg = PHI_ARG_DEF (phi, e->dest_idx);
+ if (SSA_NAME_IS_DEFAULT_DEF (arg)
+ && (!SSA_NAME_VAR (arg)
+ || TREE_CODE (SSA_NAME_VAR (arg)) != PARM_DECL))
+ continue;
+
tree res = PHI_RESULT (phi);
- tree arg = PHI_ARG_DEF (phi, e->dest_idx);
int v1 = SSA_NAME_VERSION (res);
int v2 = SSA_NAME_VERSION (arg);