From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7EA23858C54; Sat, 18 Nov 2023 10:18:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7EA23858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700302689; bh=oQDfXzNSGIageIhMRKQ2ty6sIMRC8RDdcUzwYpsT85Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=O59ZwL51IhjPykpKgs4hjxEz2Rn/McFS4CtWz4cRDOuCXKO0dtBtyXAIMfgkSm1e6 yJpsIGnRBrdWm+ZWUgIQlyTiyLTxHU/ZmiM6LjpJU3a2L92A+2duMv9XOLywTA4ltu l7nUg15HnJ1b6tkMRnofJC1IOJsAxHdeYtjQJbZI= From: "sjames at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 Date: Sat, 18 Nov 2023 10:18:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: blocker X-Bugzilla-Who: sjames at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D112572 --- Comment #8 from Sam James --- Bringing MLRegallocEvictAdvisor.cpp.o into a good build then relinking lib/libLLVMCodeGen.so.17 is enough to break it. Some selected diffs: ``` =E2=94=82 llvm::NextPowerOf2(unsigned long): =E2=94=82 /home/sam/git/llvm-project/llvm/include/llvm/Support/MathExtras.= h:356 =E2=94=82 inc %rdi =E2=94=82 unsigned int const& std::max(unsigned int const&, = unsigned int const&): =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algobase.h:262 =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/stl_algobase.h:262 =E2=94=82 cmp %eax,%edi =E2=94=82 cmovb %eax,%edi =E2=94=82 llvm::DenseMap, llvm::detail::DenseMapPair >::grow (unsigned int): =E2=94=82 /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:892 =E2=94=82 mov %edi,0x18(%rbx) =E2=94=82 allocateBuckets(): =E2=94=82 /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:899 =E2=94=82 @@ -321,9 +321,9 @@ =E2=94=82 /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:658 (discriminator 3) =E2=94=82 cmp %r10d,%edx =E2=94=82 je 135 , llvm::detail::DenseMapPair >::grow(unsigned int)+0x135> =E2=94=82 mov 0xc(%rsp),%r15d =E2=94=82 jmp 199 , llvm::detail::DenseMapPair >::grow(unsigned int)+0x199> =E2=94=82 initEmpty(): =E2=94=82 /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:658 (discriminator 3) =E2=94=82 - call 288 <.LC133> =E2=94=82 + call 288 <.LC133+0x8> ``` =E2=94=82 std::unique_ptr >::operator[](unsigned long) const: =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/unique_ptr.h:726 (di= scriminator 4) =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/unique_ptr.h:726 (discriminat= or 4) =E2=94=82 lea 0x0(%rip),%rcx # 16f7 <(anonymous namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl const&, llvm::SmallVectorImpl&, unsigned long, long, long, float, llvm::SmallVectorImpl&) const [clone .isra.0]+0x16f7> =E2=94=82 R_X86_64_PC32 .LC78-0x4 =E2=94=82 lea 0x0(%rip),%rdx # 16fe <(anonymous namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl const&, llvm::SmallVectorImpl&, unsigned long, long, long, float, llvm::SmallVectorImpl&) const [clone .isra.0]+0x16fe> =E2=94=82 R_X86_64_PC32 .LC79-0x4 =E2=94=82 mov $0x2d6,%esi =E2=94=82 lea 0x0(%rip),%rdi # 170a <(anonymous namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl const&, llvm::SmallVectorImpl&, unsigned long, long, long, float, llvm::SmallVectorImpl&) const [clone .isra.0]+0x170a> =E2=94=82 R_X86_64_PC32 .LC80-0x4 =E2=94=82 @@ -2665,9 +2665,9 @@ =E2=94=82 vxorps %xmm3,%xmm3,%xmm3 =E2=94=82 shr %rdx =E2=94=82 or %rax,%rdx =E2=94=82 vcvtsi2ss %rdx,%xmm3,%xmm0 =E2=94=82 vaddss %xmm0,%xmm0,%xmm1 =E2=94=82 jmp 472 <(anonymous namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl const&, llvm::SmallVectorImpl&, unsigned long, long, long, float, llvm::Small VectorImpl&) const [clone .isra.0]+0x472> =E2=94=82 mov %rax,%rbx =E2=94=82 - jmp 1ad0 <.LC100+0x8d8> =E2=94=82 + jmp 1ad0 <.LC100+0x8f0> ``` ``` =E2=94=82 extractInstructionFeatures(llvm::SmallVectorImpl= &, llvm::MLModelRunner*, llvm::function_ref, llvm::function_ref, llvm::function_ref, int, int, int, int, llvm::SlotIndex): =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1897 =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1897 =E2=94=82 cmp %rcx,%r12 =E2=94=82 __sort&, llvm::MLModelRunner*, llvm::function_ref, llvm::function_r ef, llvm::function_ref, int, int, in= t, int, llvm::SlotIndex):: > >(): =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1897 =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1897 =E2=94=82 je e8 &, llvm::MLModelRunner*, llvm::function_ref, llvm::function_ref, llvm::function_ref, int, int, i= nt, int, llvm::SlotIndex)+0xe8> =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1900 =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1900 =E2=94=82 mov %rbx,%rax =E2=94=82 movabs $0xaaaaaaaaaaaaaaab,%rdx =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1899 =E2=94=82 - mov %rcx,%rsi =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1899 =E2=94=82 + mov %r15,%rsi =E2=94=82 mov %r12,%rdi =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1900 =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1900 =E2=94=82 sar $0x3,%rax =E2=94=82 - mov %rcx,%r15 =E2=94=82 imul %rdx,%rax =E2=94=82 long std::__lg(long): ``` ``` =E2=94=82 __sort&, llvm::MLModelRunner*, llvm::function_ref, llvm::function_ref, llvm::function_ref, int, int, in= t, int, llvm::SlotIndex):: > >(): =E2=94=82 -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1899 =E2=94=82 +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1899 =E2=94=82 add %rdx,%rdx =E2=94=82 - call a0 &, llvm::MLModelRunner*, llvm::function_ref, llvm::function_ref, llvm::functi on_ref, int, int, int, int, llvm::SlotIndex)+0xa0> =E2=94=82 + call 9d &, llvm::MLModelRunner*, llvm::function_ref, llvm::function_ref, llvm::functi on_ref, int, int, int, int, llvm::SlotIndex)+0x9d> =E2=94=82 R_X86_64_PC32=20=20=20=20=20=20 .text._ZSt16__introsort_loopIP14LRStartEndInfolN9__gnu_cxx5__ops15_Iter_com= p_iterIZ26extractInstructionFeaturesRN4llvm15SmallVectorImplIS0_EEPNS5_13ML= ModelRunnerENS5_12function_refIFiN S5_9SlotIndexEEEENSB_IFfSC_EEENSB_IFPNS5_17MachineBasicBlockESC_EEEiiiiSC_E= UlS0_S0_E_EEEvT_SN_T0_T1_-0x4 =E2=94=82 extractInstructionFeatures(llvm::SmallVectorImpl= &, llvm::MLModelRunner*, llvm::function_ref, llvm::function_ref, llvm::function_ref, int, int, int, int, llvm::SlotIndex): ``` ``` =E2=94=82 R_X86_64_REX_GOTPCRELX vtable for llvm::RegAllocEvictionAd= visor-0x4 =E2=94=82 vzeroupper =E2=94=82 - jmp 7bb <.LC76+0x7b> =E2=94=82 + jmp 7bb <.LC76+0x83> ```=