From: Richard Biener Date: Wed, 11 Aug 2021 09:49:10 +0000 (+0200) Subject: tree-optimization/101861 - fix gather use for non-gather refs X-Git-Tag: upstream/12.2.0~5848 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f19c70afa4aa2416c581484a6eb51c0ac46acd08;p=platform%2Fupstream%2Fgcc.git tree-optimization/101861 - fix gather use for non-gather refs My previous change broke the usage of gather for strided loads. The following fixes it. 2021-08-11 Richard Biener PR tree-optimization/101861 * tree-vect-stmts.c (vectorizable_load): Fix error in previous change with regard to gather vectorization. --- diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index ab402b5..cc6c091 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -9492,7 +9492,8 @@ vectorizable_load (vec_info *vinfo, if (memory_access_type == VMAT_GATHER_SCATTER && gs_info.ifn != IFN_LAST) { - vec_offset = vec_offsets[j]; + if (STMT_VINFO_GATHER_SCATTER_P (stmt_info)) + vec_offset = vec_offsets[j]; tree zero = build_zero_cst (vectype); tree scale = size_int (gs_info.scale); gcall *call;