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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
emit_move_insn in this part of ix86_output_mi_thunk:

21464         if (!sibcall_insn_operand (fnaddr, word_mode))
21465           {
21466             tmp = gen_rtx_REG (word_mode, tmp_regno);
21467             if (GET_MODE (fnaddr) != word_mode)
21468               fnaddr = gen_rtx_ZERO_EXTEND (word_mode, fnaddr);
21469             emit_move_insn (tmp, fnaddr);
21470             fnaddr = tmp;
21471           }

is creating RTX with pseudos when trying to move fnaddr:

(symbol_ref:SI ("*.LTHUNK0") [flags 0x3] <function_decl 0x7fffea325700
*.LTHUNK0>)

to a temporary register:

(insn 6 5 7 (set (reg:SI 82)
        (plus:SI (reg:SI 82)
            (const:SI (unspec:SI [
                        (symbol_ref:SI ("*.LTHUNK0") [flags 0x3] <function_decl
0x7fffea325700 *.LTHUNK0>)
                    ] UNSPEC_GOTOFF)))) "pr105980.C":4:8 -1
     (nil))

(insn 7 6 8 (set (reg:SI 2 cx)
        (reg:SI 82)) "pr105980.C":4:8 -1
     (expr_list:REG_EQUAL (symbol_ref:SI ("*.LTHUNK0") [flags 0x3]
<function_decl 0x7fffea325700 *.LTHUNK0>)
        (nil)))

This won't fly when we are in the final pass, way late after reload.

Reply via email to