Bug 83052 - ICE in extract_insn, at recog.c:2305 with -mcmodel=large
Summary: ICE in extract_insn, at recog.c:2305 with -mcmodel=large
Status: RESOLVED DUPLICATE of bug 89289
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-19 21:39 UTC by Martin Liška
Modified: 2022-09-08 01:39 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-*-*, i?86-*-*
Build:
Known to work:
Known to fail: 4.5.0, 5.4.0, 6.4.0, 7.2.0, 8.0
Last reconfirmed: 2017-11-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liška 2017-11-19 21:39:03 UTC
After Andi's patch we ICE on:

$ gcc /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/tls/run-ld.c -mforce-indirect-call
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/tls/run-ld.c: In function ‘get_ld’:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/tls/run-ld.c:13:1: error: unrecognizable insn:
 }
 ^
(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 ("tls_ld") [flags 0x12] <var_decl 0x7f9b58913e10 tls_ld>)
                    (reg/f:DI 7 sp)
                ] UNSPEC_TLS_GD)
        ]) "/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/tls/run-ld.c":12 -1
     (expr_list:REG_EH_REGION (const_int -2147483648 [0xffffffff80000000])
        (nil))
    (nil))
during RTL pass: vregs
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/tls/run-ld.c:13:1: internal compiler error: in extract_insn, at recog.c:2305
0x5be174 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
	../../gcc/rtl-error.c:108
0x5be193 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
	../../gcc/rtl-error.c:116
0xb2d9af extract_insn(rtx_insn*)
	../../gcc/recog.c:2305
0x8dae81 instantiate_virtual_regs_in_insn
	../../gcc/function.c:1639
0x8dae81 instantiate_virtual_regs
	../../gcc/function.c:1959
0x8dae81 execute
	../../gcc/function.c:2008
Comment 1 Andi Kleen 2017-11-20 15:40:12 UTC
I'm not sure why you call it a regression? You must be running the test suite manually with the new option. 

I haven't tested, but likely it will fail if you run that test with -mcmodel=large too. The -mforce-indirect-call patch is really only a subset
of -mcmodel=large.  Then it would be more a latent bug.
Comment 2 Martin Liška 2017-11-20 19:46:45 UTC
(In reply to Andi Kleen from comment #1)
> I'm not sure why you call it a regression? You must be running the test
> suite manually with the new option.

Sorry, I was too eager ;) and did PRs for multiple different issues.

It's very old, with -mcmodel=large, all releases I have are affected (4.5.0+).
Comment 3 Jakub Jelinek 2018-05-02 10:08:32 UTC
GCC 8.1 has been released.
Comment 4 Jakub Jelinek 2018-07-26 11:22:00 UTC
GCC 8.2 has been released.
Comment 5 Jakub Jelinek 2019-02-22 15:23:21 UTC
GCC 8.3 has been released.
Comment 6 Jakub Jelinek 2020-03-04 09:43:58 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 7 Andrew Pinski 2022-09-08 01:39:45 UTC
Even though PR 89289 is newer, it has more information on what is going wrong with -mforce-indirect-call .
Also what is not mentioned here is dynamic model is needed to hit the issue (which is what -fPIC does too).

*** This bug has been marked as a duplicate of bug 89289 ***