https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93319

            Bug ID: 93319
           Summary: -mtls-dialect=gnu2 doesn't work for x32
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com
  Target Milestone: ---
            Target: x86-64

[hjl@gnu-cfl-2 tls-x32-ld]$ cat lib.c
#include <stdio.h>

static __thread int foo = 30;

int *
test (void)
{
  printf ("foo: %d\n", foo);
  return &foo;
}
[hjl@gnu-cfl-2 tls-x32-ld]$ make lib.o
gcc -mx32 -B./ -O2 -g -mtls-dialect=gnu2 -fPIC   -c -o lib.o lib.c
lib.c: In function ‘test’:
lib.c:10:1: error: unrecognizable insn:
   10 | }
      | ^
(insn 6 5 7 2 (set (reg:SI 85)
        (unspec:DI [
                (symbol_ref:SI ("_TLS_MODULE_BASE_") [flags 0x10])
            ] UNSPEC_TLSDESC)) "lib.c":8:3 -1
     (nil))
during RTL pass: vregs
lib.c:10:1: internal compiler error: in extract_insn, at recog.c:2310

Reply via email to