Fix reduc_index calculation in vectorizable_condition
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 29 Oct 2019 10:41:45 +0000 (10:41 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 29 Oct 2019 10:41:45 +0000 (10:41 +0000)
Fixes ICEs in gcc.target/aarch64/sve/clastb*.

2019-10-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-stmts.c (vectorizable_condition): Get the reduction
index for the COND_EXPR from stmt_info rather than reduc_info.

From-SVN: r277567

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

index 77c8b185c6da674ebcfc8cf8271e1fd78d61c1ec..1c429520386e17bce92c51c87a91c792b97bb855 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-29  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-vect-stmts.c (vectorizable_condition): Get the reduction
+       index for the COND_EXPR from stmt_info rather than reduc_info.
+
 2019-10-29  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/65930
index abc827f738ee45afc3990c8605add79466959643..7f5228208a038c3eb7f8d1606c75bfa36e88dc4d 100644 (file)
@@ -9882,7 +9882,7 @@ vectorizable_condition (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
        return false;
       reduc_info = info_for_reduction (stmt_info);
       reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info);
-      reduc_index = STMT_VINFO_REDUC_IDX (reduc_info);
+      reduc_index = STMT_VINFO_REDUC_IDX (stmt_info);
       gcc_assert (reduction_type != EXTRACT_LAST_REDUCTION
                  || reduc_index != -1);
     }