From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5CBFD3858C3A; Thu, 12 Sep 2024 11:51:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CBFD3858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1726141905; bh=Imzd3sVCfkdbrxuBndT8gpeQuijpTwoUop2TYFRBkz0=; h=From:To:Subject:Date:From; b=h/wmTvtjEgx2QOC5K2d81OQlLvcF2B30EofK0G60sYxJvVaiP5kqdJV9kAKMwCnNf h7Yicc+JgEyTi0mg5VdJZZpDA9Xoy6qL/9RIrQn9ytymX0tbrXraimbdcBDHyD6NSi 27pOUs2+hw9aT3F5hgZ2Te+PgPyE4jliVoycdVDo= From: "schwab@linux-m68k.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/116693] New: [RISC-V] @tlsdesc generates duplicate assembler labels Date: Thu, 12 Sep 2024 11:51:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.2.0 X-Bugzilla-Keywords: assemble-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: schwab@linux-m68k.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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: 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=3D116693 Bug ID: 116693 Summary: [RISC-V] @tlsdesc generates duplicate assembler labels Product: gcc Version: 14.2.0 Status: UNCONFIRMED Keywords: assemble-failure Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: schwab@linux-m68k.org Target Milestone: --- Target: riscv*-*-* Current mesa fails to build with LTO because it emits duplicate assembler labels. src/gallium/targets/dri/libgallium-24.2.2.so.ltrans125.ltrans.s: Assembler messages: src/gallium/targets/dri/libgallium-24.2.2.so.ltrans125.ltrans.s:132389: Err= or: symbol `.LT178' is already defined src/gallium/targets/dri/libgallium-24.2.2.so.ltrans125.ltrans.s:135408: Err= or: symbol `.LT226' is already defined src/gallium/targets/dri/libgallium-24.2.2.so.ltrans125.ltrans.s:136590: Err= or: symbol `.LT250' is already defined make: *** [/tmp/ccU08NIk.mk:252: src/gallium/targets/dri/libgallium-24.2.2.so.ltrans125.ltrans.o] Error 1 .LBB33241: .loc 87 51 35 .LT178: auipc=20=20 a0,%tlsdesc_hi(_ZGVZN4r60010MemoryPool8instanceEvE2me.lto_priv.0) ld t0,%tlsdesc_load_lo(.LT178)(a0) addi a0,a0,%tlsdesc_add_lo(.LT178) jalr t0,t0,%tlsdesc_call(.LT178) The problem is that the @tlsdesc insn uses a label number that is only unique at the time of the generation, but when the insn is duplicated the l= abel number is not updated. The pattern should use the %=3D format instead of maintaining the label num= ber explicitly.=