From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8DCDB3857C6A; Tue, 8 Feb 2022 18:54:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DCDB3857C6A From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/100354] [9/10/11/12 regression] aarch64: non-deligitimized UNSPEC UNSPEC_TLS (76) found in variable location Date: Tue, 08 Feb 2022 18:54:50 +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: 9.3.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 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 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: Tue, 08 Feb 2022 18:54:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100354 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ktkachov at gcc dot gnu.or= g, | |rearnsha at gcc dot gnu.or= g, | |rsandifo at gcc dot gnu.org --- Comment #7 from Jakub Jelinek --- It could be e.g. done by having the targetm.const_not_ok_for_debug_p target hook not return true for the UNSPEC_TLS case and have some new target hook = that would handle emitting debug info for an UNSPEC. Or a way to just quiet the note (I'll repeat it is -fchecking only) would b= e to use as the operand of UNSPEC_TLS not const0_rtx as it does, but some magic SYMBOL_REF with SYMBOL_REF_TLS_MODEL non-zero on it. Say like: --- gcc/config/aarch64/aarch64.md.jj 2022-01-11 23:11:21.682300103 +0100 +++ gcc/config/aarch64/aarch64.md 2022-02-08 19:51:00.581676457 +0100 @@ -6833,7 +6833,8 @@ (define_insn "ldr_got_tiny_sidi" (define_insn "aarch64_load_tp_hard" [(set (match_operand:DI 0 "register_operand" "=3Dr") - (unspec:DI [(const_int 0)] UNSPEC_TLS))] + (unspec:DI [(match_operand 1 "aarch64_tls_le_symref" "S")] + UNSPEC_TLS))] "" "mrs\\t%0, tpidr_el0" [(set_attr "type" "mrs")] --- gcc/config/aarch64/aarch64.cc.jj 2022-02-04 14:36:54.262615676 +0100 +++ gcc/config/aarch64/aarch64.cc 2022-02-08 19:46:58.206051731 +0100 @@ -18474,7 +18474,9 @@ aarch64_load_tp (rtx target) target =3D gen_reg_rtx (Pmode); /* Can return in any reg. */ - emit_insn (gen_aarch64_load_tp_hard (target)); + rtx sym =3D gen_rtx_SYMBOL_REF (Pmode, ""); + SYMBOL_REF_FLAGS (sym) =3D TLS_MODEL_LOCAL_EXEC << SYMBOL_FLAG_TLS_SHIFT; + emit_insn (gen_aarch64_load_tp_hard (target, sym)); return target; }=