From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 05F68396BC0A; Wed, 11 Aug 2021 14:21:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05F68396BC0A From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/61810] init-regs.c papers over issues elsewhere Date: Wed, 11 Aug 2021 14:21:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization, 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: 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: Wed, 11 Aug 2021 14:21:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61810 --- Comment #5 from Richard Biener --- Re-running the experiment of disabling init-regs on x86_64 on trunk shows +FAIL: gcc.dg/lto/pr48622 c_lto_pr48622_0.o-c_lto_pr48622_0.o link, -O -flto -fi nline-small-functions -fno-early-inlining FAIL: gcc.dg/tree-prof/20050826-2.c scan-tree-dump-not dom2 "Invalid sum" +FAIL: gcc.target/i386/extract-insert-combining.c scan-assembler-times (?:vmovd| movd)[ \\\\t]+[^{\\n]*%xmm[0-9] 3 +FAIL: gcc.target/i386/extract-insert-combining.c scan-assembler-times (?:vpinsr d|pinsrd)[ \\\\t]+[^{\\n]*%xmm[0-9] 1 +FAIL: gnat.dg/sso8.adb execution test with both -m64 and -m32 The gcc.dg/lto/pr48622 failure is a link-fail: /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /tmp/cc8guozm.ltrans0.ltrans.o: in function `main':^M :(.text+0x18): undefined reference to `ashift_qi_1'^M collect2: error: ld returned 1 exit status^M compiler exited with status 1 I think the testcase is broken - with initregs likely the int main () { if (ashift_qi_0 (0xff) !=3D (u8) ((u8) 0xff << 0)) abort (); test directly resolved to abort (), leaving the rest of the code dead. The gcc.target/i386/extract-insert-combining.c looks like a combine missed optimization when facing uninitialized regs compared to all-zero. We get pinsrd $0, %esi, %xmm0 pinsrd $0, %edi, %xmm1 movl %esi, -12(%rsp) paddd %xmm0, %xmm1 pinsrd $0, %esi, %xmm0 paddd %xmm1, %xmm0 movd %xmm0, %eax ret preserving the "uninitialized" state of %xmm0 high, when initregs explicitely zeros %xmm0 then this is matched to movd. I cannot assess what goes wrong with gnat.dg/sso8.adb, but it might be a testsuite bug as well.=