This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][RFC, Reload]. Reload bug?
- From: Tejas Belagod <tbelagod at arm dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 04 Jul 2012 11:41:24 +0100
- Subject: Re: [PATCH][RFC, Reload]. Reload bug?
- References: <201206291134.q5TBYbLw025341@d06av02.portsmouth.uk.ibm.com> <4FEDB2E5.email@example.com>
Tejas Belagod wrote:
Ulrich Weigand wrote:
Tejas Belagod wrote:
Therefore strict_memory_address_addr_space_P () thinks thatHuh. I would have expected the offsettable_memref_p check
(mem:OI (reg sp)) is a valid target address and lets it pass as
a subreg and does not narrow the subreg into a narrower memref.
find_reloads_toplev () should have infact given
(mem:OI (plus:DI (reg sp) (const_int 16)))
which will be returned as false as base+offset is invalid for NEON
addressing modes and this will be reloaded into a narrower memref.
- && (reg_equiv_address (regno) != 0
- || (reg_equiv_mem (regno) != 0
- && (! strict_memory_address_addr_space_p
- (GET_MODE (x), XEXP (reg_equiv_mem (regno), 0),
- MEM_ADDR_SPACE (reg_equiv_mem (regno)))
- || ! offsettable_memref_p (reg_equiv_mem (regno))
- || num_not_at_initial_offset))))
to fail, which should cause find_reloads_subreg_address to get called.
Why is that not happening for you?
This is because offsettable_address_addr_space_p () gets as far as calling
strict_memory_address_addr_space_p () with a QImode and (mode_sz - 1) which
returns true. The only way I see offsettable_address_addr_space_p () returning
false would be mode_dependent_address_p () to return true for addr expression
(PLUS (reg) (16)) which partly makes sense to me because PLUS is a
mode-dependent address in that it cannot be allowed for NEON addressing modes,
but it seems very generic for mode_dependent_address_p () to return true for
PLUS in general instead of making a special case for vector modes. This
distinction cannot be made in the target's mode_dependent_address_p() as 'mode'
is not supplied to it.
I dug a little deeper into offsettable_address_addr_space_p () and realized that
it only gets reg_equiv_mem () which is MEM:OI (reg sp) to work with which does
not include the SUBREG_BYTE, therefore mode_dependent_address_p () does not have
PLUS to check for address tree-mode dependency.