re PR tree-optimization/90385 (ICE: tree check: expected ssa_name, have real_cst...
authorJakub Jelinek <jakub@redhat.com>
Fri, 10 May 2019 08:20:38 +0000 (10:20 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 May 2019 08:20:38 +0000 (10:20 +0200)
PR tree-optimization/90385
* tree-parloops.c (try_create_reduction_list): Punt on non-SSA_NAME
arguments of the exit phis.

* gfortran.dg/pr90385.f90: New test.

From-SVN: r271059

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr90385.f90 [new file with mode: 0644]
gcc/tree-parloops.c

index d1b912307c0ac8da3ad59dfd21ab5cba512ec285..0379ead802aa718eeb56ef2f93a548682393fff2 100644 (file)
@@ -1,5 +1,9 @@
 2019-05-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/90385
+       * tree-parloops.c (try_create_reduction_list): Punt on non-SSA_NAME
+       arguments of the exit phis.
+
        PR c++/90383
        * tree-inline.h (struct copy_body_data): Add do_not_fold member.
        * tree-inline.c (remap_gimple_op_r): Avoid folding expressions if
index 0ca0b5a2a2ed25ce204219078e263191d0d36205..b42e68cf849f2dcd48ba75bb58c0225e6e8835f8 100644 (file)
@@ -1,5 +1,8 @@
 2019-05-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/90385
+       * gfortran.dg/pr90385.f90: New test.
+
        PR c++/90383
        * g++.dg/cpp1y/constexpr-90383-1.C: New test.
        * g++.dg/cpp1y/constexpr-90383-2.C: New test.
diff --git a/gcc/testsuite/gfortran.dg/pr90385.f90 b/gcc/testsuite/gfortran.dg/pr90385.f90
new file mode 100644 (file)
index 0000000..5ce34aa
--- /dev/null
@@ -0,0 +1,6 @@
+! PR tree-optimization/90385
+! { dg-do compile }
+! { dg-require-effective-target pthread }
+! { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-ccp -fno-tree-ch -fno-tree-copy-prop -fno-tree-forwprop -fno-tree-sink --param parloops-min-per-thread=5" }
+
+include 'array_constructor_47.f90'
index 968368f7f441bb5f39197c425545acf3c40dca01..9de154e722f9542ebbe5abaad6da0c63d706ceaf 100644 (file)
@@ -2794,8 +2794,16 @@ try_create_reduction_list (loop_p loop,
       gimple *reduc_phi;
       tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit);
 
-      if (TREE_CODE (val) == SSA_NAME && !virtual_operand_p (val))
+      if (!virtual_operand_p (val))
        {
+         if (TREE_CODE (val) != SSA_NAME)
+           {
+             if (dump_file && (dump_flags & TDF_DETAILS))
+               fprintf (dump_file,
+                        "  FAILED: exit PHI argument invariant.\n");
+             return false;
+           }
+
          if (dump_file && (dump_flags & TDF_DETAILS))
            {
              fprintf (dump_file, "phi is ");