From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 89AC3385841A; Fri, 22 Mar 2024 08:06:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89AC3385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711094771; bh=z97b746ML1/QljmgikYOfS62zvqRcEEEYyhq+MJM5is=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cpcuA9np0bgU+aRW+3T4ryhLcQFTCB8ZjyVJUBY3taZ81dZb+4xe+LR2g0m/9ddOY AsQ9EbDbaV3Y1RpnJCYRQxhX1pw3Oz9qEGNbNUVteD59drr8Bd9brLdu6y5HfztnHI Mltk77x4Zwhn744Op1bi9c0Z+1COKl0NlH/lzp24= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/111683] [11/12/13/14 Regression] Incorrect answer when using SSE2 intrinsics with -O3 since r7-3163-g973625a04b3d9351f2485e37f7d3382af2aed87e Date: Fri, 22 Mar 2024 08:06:11 +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: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned 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 #19 from Richard Biener --- But note that {0, +, 3 } and {2, + , 3} with size 2 will still eventually overlap. See dr_analyze_indices where we attempt to make DR_INIT a multiple of the element size (probably also not a perfect solution). In the end representing the access function for the pointer with byte granularity is a mistake and it should be translated to be based on the access size. That of course makes a byte step of 3 with an access size of 2 not representable (but it avoids these kind of issues). The other possibility is to filter the remaining problematic cases during dependence analysis itself where we see both DR_INITs. As said the index based dependence analysis doesn't know about such thing as partial element overlaps. For the PR at hand your patch looks reasonable, but I think there's a problem in how we handle the pointer-based access functions.=