From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13CE03858D33; Mon, 26 Jun 2023 08:35:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13CE03858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687768542; bh=xLQfGYYlFg6nBnr1VAVVXOY8vGf/3se4MZffLZqCWk8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gO2298kFbJVU0aJ8DYTS0Xy/rP8yAip/2CnAk3MKKiv1WjQAVUh/Xw4LtRaH285jR a1J4Z9ge9F9aHcxbpF7GlEeXQ3NxwxYbLl5BJdFw2P+KGYcMsMWK1udKUkEuiDhcKH CCl6hng1Bv3/MZPeszOup5RXpwKv2jgDP1v0MkiI= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/110237] gcc.dg/torture/pr58955-2.c is miscompiled by RTL scheduling after reload Date: Mon, 26 Jun 2023 08:35:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D110237 --- Comment #14 from rguenther at suse dot de --- On Mon, 26 Jun 2023, amonakov at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110237 >=20 > --- Comment #13 from Alexander Monakov --- > (In reply to rguenther@suse.de from comment #12) > > As explained in comment#3 the issue is related to the tree alias oracle > > part that gets invoked on the MEM_EXPR for the load where there is > > no information that the load could be partial so it gets disambiguated > > against a decl that's off less size than the full vector. >=20 > With my example I'm trying to say that types in the IR are wrong if we > disambiguate like that. People writing C need to attach may_alias to vect= or > types for plain load/stores to validly overlap with scalar accesses, and = when > vectorizer introduces vector accesses it needs to do something like that,= or > else intermixed scalar accesses may be incorrectly disambiguated against = new > vector ones. vectors of T and scalar T interoperate TBAA wise. What we disambiguate is int a[2]; int foo(int *p) { a[0] =3D 1; *(v4si *)p =3D {0,0,0,0}; return a[0]; } because the V4SI vector store is too large for the a[] object. That doesn't even use TBAA (it works with -fno-strict-aliasing just fine). If the v4si store is masked we cannot do this anymore, but the IL we seed the alias oracle with doesn't know the store is partial. The only way to "fix" it is to take away all of the information from it.=