find_reload forces a constant into memory.

Dmitri Makarov
Tue Feb 8 16:36:00 GMT 2000

A register equivalent to a constant being reloaded.  For some reason
find_reload (...) finds the constant not suitable for replacing the
register and forces the constant into memory, calling
force_const_mem (...).  The problem is the constant never been output
in assembler file.  This breaks assembler when it tries to resolve the
symbol.  Here's rtl insn before find_reload

(insn 35 32 36 (set (reg:HI 41)
        (subreg:HI (reg:SI 42) 0)) 194 {*movhi_insn_littleend} (insn_list/c:REG_DEP_OUTPUT 32 (nil))
    (expr_list:REG_EQUAL (const_int -24576 [0xffffa000])

Here's rtl after

(insn 35 161 36 (set (reg:HI 3 r3)
        (mem/u:HI (symbol_ref/u:SI ("*.LC1")) 0)) 194 {*movhi_insn_littleend} (insn_list/c:REG_DEP_OUTPUT 32 (nil))
    (expr_list:REG_EQUAL (const_int -24576 [0xffffa000])

As one can see (subreg:HI (reg:SI 42) 0) substituted by
(mem/u:HI (symbol_ref/u:SI ("*.LC1")) 0).

As a result in assembler output there's this insn:

ldr	r3, .LC1 @ movhi @ 35 *movhi_insn_littleend/3 [length = 4]

But! .LC1 never defined in .s file.

The --target is arm--elf.  Compiler sources are just cvs updated.
Could someone give me a hint what to look at to solve the problem?


More information about the Gcc mailing list