From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2063) id 68C673858401; Mon, 8 Nov 2021 05:33:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68C673858401 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kewen Lin To: gcc-cvs@gcc.gnu.org Subject: [gcc r10-10257] vect: Don't update inits for simd_lane_access DRs [PR102789] X-Act-Checkin: gcc X-Git-Author: Kewen Lin X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: ad96f70c6c485edf8fede8c4ad2ddc2b9f99cee8 X-Git-Newrev: 4f024c99a05f1c6852d1e5daad4a172f4cdd24a1 Message-Id: <20211108053317.68C673858401@sourceware.org> Date: Mon, 8 Nov 2021 05:33:17 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2021 05:33:17 -0000 https://gcc.gnu.org/g:4f024c99a05f1c6852d1e5daad4a172f4cdd24a1 commit r10-10257-g4f024c99a05f1c6852d1e5daad4a172f4cdd24a1 Author: Kewen Lin Date: Mon Oct 25 21:05:02 2021 -0500 vect: Don't update inits for simd_lane_access DRs [PR102789] As PR102789 shows, when vectorizer does some peelings for alignment in prologues, function vect_update_inits_of_drs would update the inits of some drs. But as the failed case, we shouldn't update the dr for simd_lane_access, it has the fixed-length storage mainly for the main loop, the update can make the access out of bound and access the unexpected element. gcc/ChangeLog: PR tree-optimization/102789 * tree-vect-loop-manip.c (vect_update_inits_of_drs): Do not update inits of simd_lane_access. (cherry picked from commit f3dbd3f36d55178d0a9e4431043cbc950524969a) Diff: --- gcc/tree-vect-loop-manip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index df37aead882..639d8ceabf0 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1760,7 +1760,8 @@ vect_update_inits_of_drs (loop_vec_info loop_vinfo, tree niters, FOR_EACH_VEC_ELT (datarefs, i, dr) { dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr); - if (!STMT_VINFO_GATHER_SCATTER_P (dr_info->stmt)) + if (!STMT_VINFO_GATHER_SCATTER_P (dr_info->stmt) + && !STMT_VINFO_SIMD_LANE_ACCESS_P (dr_info->stmt)) vect_update_init_of_dr (dr_info, niters, code); } }