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

--- Comment #6 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Cross-compiler needs HAVE_AS_EXPLICIT_RELOCS=1.

With checking enabled, we get:

t.c:8:1: error: flow control insn inside a basic block
(call_insn 97 96 98 4 (parallel [
            (set (reg:DI 0 $0)
                (call (mem:DI (reg:DI 27 $27) [0  S8 A64])
                    (const_int 0 [0])))
            (set (reg:DI 29 $29)
                (unspec:DI [
                        (reg:DI 29 $29)
                        (const_int 6 [0x6])
                    ] UNSPEC_LDGP1))
            (use (symbol_ref:DI ("__tls_get_addr") [flags 0x41]  <function_decl
0x7f642d9ec400 __tls_get_addr>))
            (use (unspec [
                        (const_int 1 [0x1])
                    ] UNSPEC_TLSGD_CALL))
            (clobber (reg:DI 26 $26))
        ]) "t.c":6:22 -1
     (nil)
    (expr_list (use (reg:DI 16 $16))
        (nil)))
during RTL pass: peephole2
dump file: t.c.313r.peephole2
t.c:8:1: internal compiler error: in rtl_verify_bb_insns, at cfgrtl.cc:2797


Insn 96 appears via:

Splitting with gen_peephole2_8 (alpha.md:5972)
scanning new insn with uid = 96.
scanning new insn with uid = 97.
scanning new insn with uid = 98.
deleting insn with uid = 25.

Insn 25 was:

(call_insn/u 25 39 26 4 (parallel [
            (set (reg:DI 0 $0)
                (call (mem:DI (symbol_ref:DI ("__tls_get_addr") [flags 0x41] 
<function_decl 0x7f642d9ec400 __tls_get_addr>) [0  S8 A64])
                    (const_int 0 [0])))
            (unspec [
                    (const_int 1 [0x1])
                ] UNSPEC_TLSGD_CALL)
            (use (reg:DI 29 $29))
            (clobber (reg:DI 26 $26))
        ]) "t.c":6:22 346 {call_value_osf_tlsgd}
     (expr_list:REG_DEAD (reg:DI 16 $16)
        (expr_list:REG_EH_REGION (const_int -2147483648 [0xffffffff80000000])
            (nil)))
    (expr_list (use (reg:DI 16 $16))
        (nil)))

Note the REG_EH_REGION. This is relevant because can_nonlocal_goto checks it,
so for insn 25 we knew it wouldn't return to the setjmp receiver. Applying the
peephole dropped the note.

Reply via email to