From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 231223986C0E; Tue, 15 Jun 2021 07:31:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 231223986C0E From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101061] tree-vrp misoptimization on skylake+ using union-based aliasing Date: Tue, 15 Jun 2021 07:31:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 8.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2021 07:31:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101061 --- Comment #2 from Richard Biener --- If it is related to those union accesses then it should have nothing to do = with -ftree-vrp but it should vanish with -O2 -fno-strict-aliasing at least. Note we do not implement any of "layout compatible" (whatever that exactly = is) for union members but if the difference is really just 'const T' vs. 'T' th= en this should work. Also note that GCC 8 is no longer supported and there's a newer 8.5.0 relea= se available as well. It looks like the bug requires quite special circumstances to happen thus i= t's likely just gone latent with newer compilers and/or different flags. Unfortunately the preprocessed source lacks a main() and thus it's hard to determine whether the bug occurs or not. If you have ways to pinpoint the function where things go wrong then it might be possible to spot a wrong transform there (but a C++ code base is always hard to analyze because of a= ll the inlining and abstraction that happens).=