From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3AC07385803E; Fri, 26 Jan 2024 14:22:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AC07385803E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706278961; bh=8cDIGAjjpyb4vQUATWf34L1kPLOIIiLTqhQGqGe6F9U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sz4Jn9DBvL38AO0yw3D4PBZqOX//BiM7pB30o/pNp9nc5Q+it2cscju0rTjzu2kA+ Txbw0xltrLih4Y+1f9tjhe1D7sjslnC0bBVrXZgktLhfQhWNNj0ACeQ+MJENqiJ2+t zchPsQBqcT7Ygo+OOAWXk24W9AuQinrsqnK4PRLw= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/113617] [14 Regression] Symbol ... referenced in section `.data.rel.ro.local' of ...: defined in discarded section ... since r14-4944 Date: Fri, 26 Jan 2024 14:22:40 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW 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: cc 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=3D113617 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |crazylht at gmail dot com --- Comment #3 from H.J. Lu --- (In reply to Jakub Jelinek from comment #0) > Since r14-4944-gf55cdce3f8dd8503e080e35be59c5f5390f6d95e the following > testcase can't be linked anymore. > for i in 1 2; do ./cc1plus -quiet -O2 -std=3Dc++11 -fPIC -fvisibility=3Dh= idden > -fvisibility-inlines-hidden $i.ii; done; g++ -shared -o 1.so 1.s 2.s > `_ZNSt17_Function_handlerIFvvESt5_BindIFPFvPvxxxEPN3vtk6detail3smp27vtkSM= PToo > ls_FunctorInternalIN12_GLOBAL__N_19CountUsesIxEELb0EEExxxEEE10_M_managerE= RSt9 > _Any_dataRKSH_St18_Manager_operation' referenced in section > `.data.rel.ro.local' of /tmp/ccEORVfz.o: defined in discarded section > `.text. > _ZNSt17_Function_handlerIFvvESt5_BindIFPFvPvxxxEPN3vtk6detail3smp27vtkSMP= Tool > s_FunctorInternalIN12_GLOBAL__N_19CountUsesIxEELb0EEExxxEEE10_M_managerER= St9_ > Any_dataRKSH_St18_Manager_operation[_ZN26vtkStaticCellLinksTemplateIxE18T= hrea > dedBuildLinksExxP12vtkCellArray]' of /tmp/ccEORVfz.o > `_ZNSt17_Function_handlerIFvvESt5_BindIFPFvPvxxxEPN3vtk6detail3smp27vtkSM= PToo > ls_FunctorInternalIN12_GLOBAL__N_111InsertLinksIxEELb0EEExxxEEE10_M_manag= erER > St9_Any_dataRKSH_St18_Manager_operation' referenced in section > `.data.rel.ro.local' of /tmp/ccEORVfz.o: defined in discarded section > `.text. > _ZNSt17_Function_handlerIFvvESt5_BindIFPFvPvxxxEPN3vtk6detail3smp27vtkSMP= Tool > s_FunctorInternalIN12_GLOBAL__N_111InsertLinksIxEELb0EEExxxEEE10_M_manage= rERS > t9_Any_dataRKSH_St18_Manager_operation[_ZN26vtkStaticCellLinksTemplateIxE= 18Th > readedBuildLinksExxP12vtkCellArray]' of /tmp/ccEORVfz.o >=20 > That change adds quite a few changes like: >=20 > - leaq=20=20=20 > _ZNSt17_Function_handlerIFvvESt5_BindIFPFvPvxxxEPN3vtk6detail3smp27vtkSMP= Tool > s_FunctorInternalIN12_GLOBAL__N_19CountUsesIxEELb0EEExxxEEE10_M_managerER= St9_ > Any_dataRKSH > _St18_Manager_operation(%rip), %rdx > + movq .LC73(%rip), %xmm3 > movq $0, (%rsp) > movq %rax, 32(%rsp) > leaq=20=20=20 > _ZNSt17_Function_handlerIFvvESt5_BindIFPFvPvxxxEPN3vtk6detail3smp27vtkSMP= Tool > s_FunctorInternalIN12_GLOBAL__N_19CountUsesIxEELb0EEExxxEEE9_M_invokeERKS= t9_A > ny_data(%rip), %rax > - movq %rdx, %xmm3 > ... > + .section .data.rel.ro.local,"aw" > ... > +.LC73: > + .quad=20=20 > _ZNSt17_Function_handlerIFvvESt5_BindIFPFvPvxxxEPN3vtk6detail3smp27vtkSMP= Tool > s_FunctorInternalIN12_GLOBAL__N_19CountUsesIxEELb0EEExxxEEE10_M_managerER= St9_ > Any_dataRKSH_St18_Manager_operation > but as the symbol is defined in a comdat section, that results in the lin= ker > error. > Dunno if this was just latent before, or whether we need to force such > constants also into comdat sections in the same comdat group, etc. LEA is changed to load through an indirection. Isn't it a regression?=