re PR tree-optimization/90211 (ICE: tree check: expected ssa_name, have real_cst...
authorJakub Jelinek <jakub@redhat.com>
Wed, 24 Apr 2019 08:13:29 +0000 (10:13 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 24 Apr 2019 08:13:29 +0000 (10:13 +0200)
PR tree-optimization/90211
* tree-parloops.c (try_create_reduction_list): Ignore phi arguments
which are not SSA_NAMEs.

* gcc.dg/autopar/pr90211.c: New test.

From-SVN: r270533

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/autopar/pr90211.c [new file with mode: 0644]
gcc/tree-parloops.c

index 2c1cc3774a101265c17adeff43c82d419ee8fbec..d4af0fd1724778128a4b18a2ef0966de329090ab 100644 (file)
@@ -1,10 +1,15 @@
+2019-04-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/90211
+       * tree-parloops.c (try_create_reduction_list): Ignore phi arguments
+       which are not SSA_NAMEs.
+
 2018-04-23  Sudakshina Das  <sudi.das@arm.com>
 
        * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define for
        AArch64.
        (aarch64_file_end_indicate_exec_stack): Add gnu note section.
 
-
 2019-04-23  Roman Zhuykov  <zhroma@ispras.ru>
 
        PR rtl-optimization/87979
index 66d0b6f7562a769a8dd77e3123e0065c40587be4..b301146a5f8d7975d0f075c6e9b33b87e44553a3 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-24  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/90211
+       * gcc.dg/autopar/pr90211.c: New test.
+
 2019-04-23  Iain Buclaw  <ibuclaw@gdcproject.org>
            Robin Dapp  <rdapp@linux.ibm.com>
 
diff --git a/gcc/testsuite/gcc.dg/autopar/pr90211.c b/gcc/testsuite/gcc.dg/autopar/pr90211.c
new file mode 100644 (file)
index 0000000..ba314eb
--- /dev/null
@@ -0,0 +1,24 @@
+/* PR tree-optimization/90211 */
+/* { dg-do compile } */
+/* { dg-require-effective-target pthread } */
+/* { dg-options "-O3 -fassociative-math -ftree-parallelize-loops=2 -fno-signed-zeros -fno-trapping-math -fno-tree-copy-prop" } */
+
+double
+foo (int x)
+{
+  double a, b = 0.0;
+  while (x < 3)
+    {
+      int c;
+      a = 0.0;
+      c = 0;
+      while (c < x)
+        {
+          a += 1.0;
+          ++c;
+        }
+      b += 1.0;
+      ++x;
+    }
+  return a + b;
+}
index 7124c5b1ab576c6d658d37b26708907b31392dd3..2fddc59beb21757412ba8f3b565425a24ffafab4 100644 (file)
@@ -2794,7 +2794,7 @@ try_create_reduction_list (loop_p loop,
       gimple *reduc_phi;
       tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit);
 
-      if (!virtual_operand_p (val))
+      if (TREE_CODE (val) == SSA_NAME && !virtual_operand_p (val))
        {
          if (dump_file && (dump_flags & TDF_DETAILS))
            {