On Mon, Jul 18, 2011 at 10:25 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
>>>>> TARGET_MEM_REF only works on ptr_mode. This patch allows 32bit address >>>>> in x32 mode. OK for trunk? >>>> >>>> Do you perhaps have a testcase to help in analyzing the problem? >>>> >>> >>> See: >>> >>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49780 >> >> I don't think that tree-ssa-address/addr_for_mem_ref is correct when >> REALLY_EXPAND is false. It constructs RTX "template" in pointer_mode, >> which is not necessary valid and is rejected from >> ix86_validate_address_p. When really expanding the expression, we have >> a conversion at the end: >> >> gen_addr_rtx (pointer_mode, sym, bse, idx, st, off, &address, NULL, NULL); >> if (pointer_mode != address_mode) >> address = convert_memory_address (address_mode, address); >> return address; >> >> This is in fact your r175912 change in the fix for PR47383 - you need >> to do something with template as well... >> > > Since TARGET_MEM_REF only works on ptr_mode, I don't think > we can change template. We just need to accept TARGET_MEM_REF > in ptr_mode and fix it up later. No, a template is used to get some insight into the supported address structure. If there is a mismatch, this approach fails, we can as well give the compiler whatever fake template we want. Uros.