From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F25B63858CD1; Mon, 8 Apr 2024 18:06:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F25B63858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712599615; bh=8O27ewlt/9qp9XDBIpDc4OoH2y3Nu8Czf8nkQ3zcvPY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OcTnn3sBvI93f+/3ClVy5hfbXfSxdfm+czCcjDLR1BMCXhpUhJfZod7lblt5bUTUA b8afKj2m+BCXvbBfHzrhtjkkf2mgeFfp6rXPdpPI78c/AeTzammBrIaVD1aMdF1XEM sP4DanPs/zDRc1EPxGvZhPtLl9N3fOtAngktubKs= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114621] [11/12/13/14 Regression] ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn) with -O -fpie and _Thread_local with large offset Date: Mon, 08 Apr 2024 18:06:55 +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: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 11.5 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=3D114621 --- Comment #5 from Jakub Jelinek --- While for the local exec we happily use something like movq %fs:0, %rax movabsq $b@tpoff+34359738367, %rdx addq %rdx, %rax movzbl (%rax), %eax we normally use instructions like movsbl %fs:b@tpoff+31, %eax Thus, I'd say at least in the normal code models we have a restriction that= the static TLS area of the whole program must fit into 2GB. If we want to support something larger, we'd need to use 64-bit relocations consistently for all LE/IE accesses regardless of whether the immediate off= set into them is > 2GB or not, because it could just be that some other library= has the static TLS area > 2GB and comes earlier, or some other TU etc. x86-64 has both R_X86_64_TPOFF32 and R_X86_64_TPOFF64 relocations, but it wouldn't help if we use the 32-bit ones in say char a; __thread char b[0x100000000L]; __thread char c[32L]; int foo (void) { return c[31L]; } it just won't really link.=