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 6e4f145af4658f26967a1f43b5bd9339af76f0f3..9a303c5dc9a756aa4c056312203e27c45d73c166 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 31e745780baba9939303eeba62808419445be973..3db4a5cdf78ae95ce711d164fcfcfa738b9a1bd7 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 f997ad2b429b90581f009abf03d50434855f2024..cac7410387b90715494d91c41b966d263d2e3fb5 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);