From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E6BA03857000; Wed, 10 Aug 2022 13:30:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6BA03857000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106458] [12/13 Regression] glibc's malloc/tst-scratch_buffer.c test is miscompiled with gcc-12 Date: Wed, 10 Aug 2022 13:30:24 +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: 12.1.0 X-Bugzilla-Keywords: wrong-code 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: 12.2 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: Wed, 10 Aug 2022 13:30:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106458 --- Comment #11 from Richard Biener --- The dump difference is easily explained by taming PRE when -ftree-vectorize= is on, it's not a "real" difference. When I try with a cc1 cross I see > ./cc1 -quiet t.i -fpreprocessed -O2 -g -std=3Dgnu11 -fgnu89-inline -fmerg= e-all-constants -frounding-math -fno-stack-protector -fno-common -fmath-err= no -fno-pie -fopt-info-vec and nothing actually vectorized. Besides the PRE there seems to be a missed DSE at the end (when vectorization is enabled as after the change): # DEBUG BEGIN_STMT memset (&buf.__space.__c, 64, 1024); # DEBUG BEGIN_STMT + sizes[0] =3D 16; sizes[1] =3D 1024; sizes[2] =3D 1040; otherwise I see nothing suspicious in differences in .optimized when comparing -fdump-tree-optimized with/without -fno-tree-vectorize. You could try if -fno-tree-pre reproduces it also before the change.=