]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/90385 (ICE: tree check: expected ssa_name, have...
authorJakub Jelinek <jakub@redhat.com>
Fri, 17 May 2019 19:51:32 +0000 (21:51 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 17 May 2019 19:51:32 +0000 (21:51 +0200)
Backported from mainline
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.

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

From-SVN: r271352

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

index 843c03aa8744aa9daad86af0c6ce768052d021f8..ac65f1ea2f2c232bd5524f91c96723b15ac31828 100644 (file)
@@ -3,6 +3,10 @@
        Backported from mainline
        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 170106fe24af7e291586ac761f62ee5be5f9a901..42955ca1937a4c50d262d61f2dfd667a2571e57a 100644 (file)
@@ -3,6 +3,9 @@
        Backported from mainline
        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 2fddc59beb21757412ba8f3b565425a24ffafab4..c5629cc80896f10d7d0359c3b395b7d05cd905c8 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 ");