This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFC, Reload]. Reload bug?

Tejas Belagod wrote:
Ulrich Weigand wrote:
Tejas Belagod wrote:

Therefore strict_memory_address_addr_space_P () thinks that
(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 strict_memory_address_addr_space_P ()
(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.
Huh. I would have expected the offsettable_memref_p check

-	  && (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))
^^^ here
- || 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.

Tejas Belagod.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]