On 28/11/12 13:18, Hurugalawadi, Naveen wrote:
Hi,

Not to mention the ChangeLog entry.

Sorry about the missed patch and ChangeLog Entry.
Please review the patch and let me know if its OK.

Regression Tested on aarch64-elf. No new Regressions.

2012-11-28  Naveen H.S  <naveen.hurugalaw...@caviumnetworks.com>

        * aarch64.c (aarch64_load_symref_appropriately): Handle
        SYMBOL_SMALL_ABSOLUTE transfers effectively.

Regards,
Naveen



Hi, Thanks for looking into this issue.

The ICE arises because the 'X' constraint on the inline ASM statement in the test cases permits the combiner to rewrite a whole bunch of stuff ending with this:

(insn 9 8 0 2 (asm_operands/v ("") ("") 0 [
            (subreg/s/u:HI (reg:SI 73 [ D.2259 ]) 0)
        ]
         [
            (asm_input:HI ("X") (null):0)
        ]
         [] asm-subreg-1.c:13) asm-subreg-1.c:13 -1
     (expr_list:REG_DEAD (reg:SI 73 [ D.2259 ])
        (nil)))

into this:

(insn 9 8 0 2 (asm_operands/v ("") ("") 0 [
(mem/v/j/c:HI (symbol_ref:DI ("*.LANCHOR0") [flags 0x182]) [0 _const_32+0 S2 A64])
        ]
         [
            (asm_input:HI ("X") (null):0)
        ]
         [] asm-subreg-1.c:13) asm-subreg-1.c:13 -1
     (nil))


which doesn't seem unreasonable to me given that 'X' basically says allow anything.


Subsequently reload bombs because:

reload.c:find_reloads_address_part() is not prepared for force_const_mem() (which calls aarch64_cannot_force_const_mem) to return NULL.

The patch presented changes the expansion of a symbol load from this:

t <- high(s)
d <- losum(t, s)

to this:

d <- high(s)
t <- losum(d, s)
d <- t

... which prevents the combiner kicking in and the problem goes latent...

I think the real problem here is either reload not being prepared to get NULL back from force_const_mem() or aarch64_cannot_force_const_mem() being to restrictive.

Cheers
/Marcus

Reply via email to