On 05/05/2017 12:23 AM, Richard Sandiford wrote:
2017-05-05  Richard Sandiford  <richard.sandif...@linaro.org>

gcc/
        * lra-constraints.c (lra_copy_reg_equiv): New function.
        (split_reg): Use it to copy equivalence information from the
        original register to the spill register.

This patch breaks aarch64 bootstrap.  I get a link error for lto1 and f951

godump.o: In function `go_define(unsigned int, char const*)':
godump.c:(.text+0x36c): relocation truncated to fit:
R_AARCH64_ADR_PREL_LO21 against `.rodata'
godump.c:(.text+0x4b4): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against `.rodata'

The godump.c.271r.ira file looks OK, I see

(insn 237 223 225 10 (set (reg/f:DI 489)
(high:DI (label_ref 240))) "../../gcc-svn/gcc/godump.c":174 49 {*movdi_aarch64}
     (expr_list:REG_EQUIV (high:DI (label_ref 240))
        (insn_list:REG_LABEL_OPERAND 240 (nil))))
...
(insn 238 115 1157 10 (set (reg/f:DI 490)
        (lo_sum:DI (reg/f:DI 489)
(label_ref 240))) "../../gcc-svn/gcc/godump.c":174 929 {add_losym_di}
     (expr_list:REG_DEAD (reg/f:DI 489)
        (expr_list:REG_EQUIV (label_ref 240)
            (insn_list:REG_LABEL_OPERAND 240 (nil)))))

But in the godump.c.272r.reload file I see in a different basic block

(insn 1244 76 1161 22 (set (reg/f:DI 7 x7 [490])
(label_ref 240)) "../../gcc-svn/gcc/godump.c":221 49 {*movdi_aarch64}
     (nil))

which is not OK. This label ref is the address of a jumptable in the rodata section, and can't be loaded with a single instruction. It looks like there needs to be some extra work when rematerializing, to handle equiv values that can't just be copied to a register.

I haven't had a chance to step through this in a debugger to see what is going on yet.

Jim

Reply via email to