From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 038083858435; Sat, 30 Mar 2024 03:55:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 038083858435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711770932; bh=IeY9s/BpVB2ijWDBjxt90QmiYr2c/K77xsCN2OM7X+U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ou6ZXHGGMT9C7sjkoA0yowtMnlC/SWXSyfZ8XszDT+pYqaM74/Bb6G6pN5IKCMFW9 bcsIB+P7QFVmcE9pgbsPm68BDj1TGwrzLl3wDVS/Rf4C/icoz2Dc+Q+BvbsaGfAlQz gGTrJ6r3BhI94/8HgKH2mvkuq9VUKPBsxB3X5JYc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/111683] [11/12/13 Regression] Incorrect answer when using SSE2 intrinsics with -O3 since r7-3163-g973625a04b3d9351f2485e37f7d3382af2aed87e Date: Sat, 30 Mar 2024 03:55:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 10.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111683 --- Comment #28 from GCC Commits --- The releases/gcc-13 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:4320e8483bb88b49bf251451307324c06d33c0a4 commit r13-8521-g4320e8483bb88b49bf251451307324c06d33c0a4 Author: Jakub Jelinek Date: Sat Mar 23 11:17:44 2024 +0100 predcom: Punt for steps which aren't multiples of access size [PR111683] On the following testcases, there is no overlap between data references within a single iteration, but the data references have size which is t= wice as large as the step, which means the data references overlap with the = next iteration which predcom doesn't take into account. As discussed in the PR, even if the reference size is smaller than step, if step isn't a multiple of the reference size, there could be overlaps with some other iteration later on. The initial version of the patch regressed (test still passed, but pred= com didn't optimize anymore) pr71083.c which has a packed char, short struc= ture and was reading/writing the short 2 bytes in there with step 3. The following patch deals with that by retrying for COMPONENT_REFs also= the aggregate sizes etc., so that it then compares 3 bytes against step 3. In make check-gcc/check-g++ this patch I believe affects code generation for only the 2 new testcases according to statistics I've gathered. 2024-03-23 Jakub Jelinek PR middle-end/111683 * tree-predcom.cc (pcom_worker::suitable_component_p): If has_w= rite and comp_step is RS_NONZERO, return false if any reference in t= he component doesn't have DR_STEP a multiple of access size. * gcc.dg/pr111683-1.c: New test. * gcc.dg/pr111683-2.c: New test. (cherry picked from commit 8fc5593df8e0d36cc5bd8ea21097a491a634a866)=