re PR target/91982 (gcc.target/aarch64/sve/clastb_*.c tests failing with segfault)
authorRichard Biener <rguenther@suse.de>
Fri, 4 Oct 2019 09:18:26 +0000 (09:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 4 Oct 2019 09:18:26 +0000 (09:18 +0000)
2019-10-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/91982
* tree-vect-loop.c (vectorizable_live_operation): Also guard
against EXTRACT_LAST_REDUCTION.
* tree-vect-stmts.c (vect_transform_stmt): Likewise.

From-SVN: r276566

gcc/ChangeLog
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c

index 6e4f145..9a303c5 100644 (file)
@@ -1,3 +1,10 @@
+2019-10-04  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/91982
+       * tree-vect-loop.c (vectorizable_live_operation): Also guard
+       against EXTRACT_LAST_REDUCTION.
+       * tree-vect-stmts.c (vect_transform_stmt): Likewise.
+
 2019-10-04  Aldy Hernandez  <aldyh@redhat.com>
 
        (value_range_from_overflowed_bounds): Rename from
index 31e7457..3db4a5c 100644 (file)
@@ -7901,7 +7901,10 @@ vectorizable_live_operation (stmt_vec_info stmt_info,
        return true;
       if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)
        {
-         if (STMT_VINFO_REDUC_TYPE (stmt_info) == FOLD_LEFT_REDUCTION)
+         if (STMT_VINFO_REDUC_TYPE (stmt_info) == FOLD_LEFT_REDUCTION
+             || (STMT_VINFO_REDUC_TYPE (stmt_info) == COND_REDUCTION
+                 && (STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info)
+                     == EXTRACT_LAST_REDUCTION)))
            return true;
          if (slp_node)
            {
index f997ad2..cac7410 100644 (file)
@@ -10897,6 +10897,9 @@ vect_transform_stmt (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
   stmt_vec_info orig_stmt_info = vect_orig_stmt (stmt_info);
   if (!slp_node && STMT_VINFO_REDUC_DEF (orig_stmt_info)
       && STMT_VINFO_REDUC_TYPE (orig_stmt_info) != FOLD_LEFT_REDUCTION
+      && (STMT_VINFO_REDUC_TYPE (orig_stmt_info) != COND_REDUCTION
+         || (STMT_VINFO_VEC_REDUCTION_TYPE (orig_stmt_info)
+             != EXTRACT_LAST_REDUCTION))
       && is_a <gphi *> (STMT_VINFO_REDUC_DEF (orig_stmt_info)->stmt))
     {
       gphi *phi = as_a <gphi *> (STMT_VINFO_REDUC_DEF (orig_stmt_info)->stmt);