re PR tree-optimization/81083 (ICE: Unable to coalesce ssa_names 4 and 13 which are...
authorRichard Biener <rguenther@suse.de>
Wed, 14 Jun 2017 07:22:32 +0000 (07:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 14 Jun 2017 07:22:32 +0000 (07:22 +0000)
2017-06-14  Richard Biener  <rguenther@suse.de>

PR tree-optimization/81083
* tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
as values.

* gcc.dg/torture/pr81083.c: New testcase.

From-SVN: r249182

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr81083.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c

index ab872e158cc4a90f2e6caf8c7caf7840dfe11d8f..8960eabda1d063d7783dc789b8c7b1af1b0d54a3 100644 (file)
@@ -1,3 +1,9 @@
+2017-06-14  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/81083
+       * tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
+       as values.
+
 2017-06-13  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/rs6000.c: Update all comments that mentioned SPE.
index 1378dc8946c471ee8defff46890883eb0298df03..0bc4384fa6735f2faf233999b79d4fc97b845e6d 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-14  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/81083
+       * gcc.dg/torture/pr81083.c: New testcase.
+
 2017-06-14  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/tree-ssa/vrp101.c: Fix scan-tree-dump regex.
diff --git a/gcc/testsuite/gcc.dg/torture/pr81083.c b/gcc/testsuite/gcc.dg/torture/pr81083.c
new file mode 100644 (file)
index 0000000..39c3f63
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+
+void a(int arg)
+{
+  extern struct { int x; } obj;
+  setjmp();
+  obj.x = arg;
+  arg = arg;
+  if (obj.x)
+    func();
+  if (obj.x)
+    func();
+}
index ff5c800662b284994c35453c7cf8007b689d53f3..419da47b5b788c9d1a98e0a9c254fe693fa4fe4c 100644 (file)
@@ -2035,7 +2035,9 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
          ops[1] = bitsize_int (ref->size);
          ops[2] = bitsize_int (offset - offset2);
          tree val = vn_nary_build_or_lookup (rcode, vr->type, ops);
-         if (val)
+         if (val
+             && (TREE_CODE (val) != SSA_NAME
+                 || ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (val)))
            {
              vn_reference_t res = vn_reference_lookup_or_insert_for_pieces
                  (vuse, vr->set, vr->type, vr->operands, val);