From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E15F63858D37; Tue, 27 Jun 2023 09:50:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E15F63858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687859415; bh=t5+Ja5TKG5aEc/rsce6FHGJXKaoSvywUZSyOolwyJ9s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=I17bjxaSrcOooFUt7AtqwJvbTbUm+WmT5ele7ANxSOFwF/g7DYgqKmrGdDxzfDRai TLE1NoBIbWePV5Dsabyd1FoKz/UhwOWRVEL2KQZaomEEtwmEwnUocZ5jHDyjtr5Hpn cXlycIE7BKvVqokO8e25K9UNLIPaTnnRdBzM4NPM= From: "amonakov at gcc dot gnu.org" 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: Tue, 27 Jun 2023 09:50:11 +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: amonakov at gcc dot gnu.org 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 #21 from Alexander Monakov --- (In reply to rguenther@suse.de from comment #19) > But the size argument doesn't have anything to do with TBAA (and > may_alias is about TBAA). I don't think we have any way to circumvent > C object access rules. That is, for example, with -fno-strict-aliasing > the following isn't going to work. >=20 > int a; > int b; >=20 > int main() > { > a =3D 1; > b =3D 2; > if (&a + 1 =3D=3D &b) // equality compare of unrelated pointers OK > { > long x =3D *(long *)&a; // access outside of 'a' not OK > if (x !=3D 0x0000000100000002) > abort (); > } > } >=20 > there's no command-line flag or attribute to form a pointer > to an object composing 'a' and 'b' besides changing how the > storage is declared. But store-merging and SLP can introduce a wide long-sized access where on source level you had two adjacent loads or even memcpy's, so we really seem= to have a problem here and might need to be able to annotate types or individu= al accesses as "may-alias-with-oob-ok" in the IR: PR 110431.=