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

            Bug ID: 89289
           Summary: ICE in extract_insn, at recog.c:2310
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

A combination of __thread with option -mforce-indirect-call
and -fpic or -fPIC gives an ICE starting with early gcc-8
for pr24428, pr47715, pr68986 and others :


$ cat z1.c
extern __thread int a;
int f ()
{
  return a;
}


$ gcc-9-20190210 -c z1.c -fpic
$ gcc-9-20190210 -c z1.c -fpic -mforce-indirect-call
z1.c: In function 'f':
z1.c:5:1: error: unrecognizable insn:
    5 | }
      | ^
(call_insn/u 5 2 6 2 (parallel [
            (set (reg:DI 0 ax)
                (call:DI (mem:QI (symbol_ref:DI ("__tls_get_addr")) [0  S1 A8])
                    (const_int 0 [0])))
            (unspec:DI [
                    (symbol_ref:DI ("a") [flags 0x50] <var_decl 0x7f776e19eab0
a>)
                    (reg/f:DI 7 sp)
                ] UNSPEC_TLS_GD)
        ]) "z1.c":4:10 -1
     (expr_list:REG_EH_REGION (const_int -2147483648 [0xffffffff80000000])
        (nil))
    (nil))
during RTL pass: vregs
z1.c:5:1: internal compiler error: in extract_insn, at recog.c:2310
0x5aa7c0 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc/rtl-error.c:108
0x5aa7df _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc/rtl-error.c:116
0xa020e7 extract_insn(rtx_insn*)
        ../../gcc/recog.c:2310
0x817525 instantiate_virtual_regs_in_insn
        ../../gcc/function.c:1654
0x817525 instantiate_virtual_regs
        ../../gcc/function.c:1975
0x817525 execute
        ../../gcc/function.c:2024

Reply via email to