re PR tree-optimization/87700 (Compile time hog w/ -O1)
authorRichard Biener <rguenther@suse.de>
Tue, 23 Oct 2018 09:36:13 +0000 (09:36 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 23 Oct 2018 09:36:13 +0000 (09:36 +0000)
2018-10-23  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87700
* tree-ssa-copy.c (set_copy_of_val): Fix change detection logic.

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

From-SVN: r265418

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

index b334845c0646ab67232d8e819eb8b708a8aa6240..f382b209b7881f017925cdc360cd29d9062809fc 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-23  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/87700
+       * tree-ssa-copy.c (set_copy_of_val): Fix change detection logic.
+
 2018-10-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/87674
index 204e41c94af74269021125f05b2710a101c7040c..9ca348875ea6a0a63e312635f7bfd02178d9158a 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-23  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/87700
+       * gcc.dg/torture/pr87700.c: New testcase.
+
 2018-10-23  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/87693
diff --git a/gcc/testsuite/gcc.dg/torture/pr87700.c b/gcc/testsuite/gcc.dg/torture/pr87700.c
new file mode 100644 (file)
index 0000000..3aee9a5
--- /dev/null
@@ -0,0 +1,49 @@
+/* { dg-do compile } */
+
+void
+wn (int ki)
+{
+  int m8 = 0;
+  int *d6 = &ki;
+
+  if (ki == 0)
+    {
+ud:
+      for (ki = 0; ki < 1; ++ki)
+       for (m8 = 0; m8 < 1; ++m8)
+         goto ud;
+
+      d6 = &m8;
+
+y8:
+      ++m8;
+
+xw:
+      if (ki == 0)
+       {
+       }
+      else
+       {
+         for (m8 = 0; m8 < 1; ++m8)
+           {
+gt:
+             if (*d6 == 0)
+               goto y8;
+           }
+
+         for (m8 = 0; m8 < 1; ++m8)
+           {
+             goto gt;
+
+ym:
+             ;
+           }
+       }
+
+      d6 = &ki;
+
+      goto ym;
+    }
+
+  goto xw;
+}
index 0c667da2d552648a26d94f5bda83373883624623..b526758701c7cb8710a22cc1900136b9b93fdc8f 100644 (file)
@@ -155,7 +155,7 @@ set_copy_of_val (tree var, tree val)
   copy_of[ver].value = val;
 
   if (old != val
-      || (val && !operand_equal_p (old, val, 0)))
+      && (!old || !operand_equal_p (old, val, 0)))
     return true;
 
   return false;