http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53249
--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> 2012-05-06 16:00:35 UTC --- (In reply to comment #9) > "hjl.tools at gmail dot com" <gcc-bugzi...@gcc.gnu.org> writes: > > get_address_mode in dwarf2out.c works for this testcase. > > Yeah, that's what I was testing FWIW. If x32 wants to do this, > then pretty much every instance of: > > targetm.addr_space.address_mode (MEM_ADDR_SPACE (mem)) > > needs to use get_address_mode instead. So I'm trying to convert all of them. This is the minimum one: diff --git a/gcc/dse.c b/gcc/dse.c index 0523757..964804c 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -1455,7 +1455,7 @@ record_store (rtx body, bb_info_t bb_info) return 0; } - address_mode = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mem)); + address_mode = get_address_mode (mem); if (GET_MODE (mem) == BLKmode) width = MEM_SIZE (mem); @@ -2181,11 +2181,8 @@ check_mem_read_rtx (rtx *loc, void *data) mem_addr = group->canon_base_addr; } if (offset) - { - enum machine_mode address_mode - = targetm.addr_space.address_mode (MEM_ADDR_SPACE (mem)); - mem_addr = plus_constant (address_mode, mem_addr, offset); - } + mem_addr = plus_constant (get_address_mode (mem), + mem_addr, offset); } /* We ignore the clobbers in store_info. The is mildly aggressive, diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 25c8ded..9d10bac 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2113,7 +2113,7 @@ adjust_address_1 (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset, plus_constant (address_mode, XEXP (addr, 1), offset)); else - addr = plus_constant (address_mode, addr, offset); + addr = plus_constant (get_address_mode (memref), addr, offset); } new_rtx = change_address_1 (memref, mode, addr, validate); to build x32 run-time libraries for c,c++,fortran,objc,go.