On Wed, Jul 27, 2011 at 3:28 PM, Uros Bizjak <ubiz...@gmail.com> wrote:
>>>> Pmode is still in DImode and DImode addresses are *valid* addresses. >>>> For the testcase from PR, >>>> expand generates SImode symbol that is later extended to DImode and >>>> handled through movabs. >>>> >>>> Your patch just papers over this fact. Please see how >>>> *movdi_internal_rex64 handles immediates. >>>> >>> >>> For the testcase in: >>> >>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49860 >>> >>> my goal is to make TARGET_X32 to generate code very similar to >>> TARGET_32BIT, except for r8-r15. How can we achieve that? >> >> Unless you can prevent DImode symbols in ix86_legitimate_constant_p, we >> can't. > > _Perhaps_ we can reject large offsets for X32 from > ix86_legitimate_constant_p here: > > if (GET_CODE (x) == PLUS) > { > if (!CONST_INT_P (XEXP (x, 1))) > return false; > x = XEXP (x, 0); > } > > (I didn't test this idea yet). This won't fly: pr49860.c:18:1: error: unrecognizable insn: (insn 61 65 62 4 (set (reg:DI 96) (const:DI (plus:DI (symbol_ref:DI ("outbuf") [flags 0x40] <var_decl 0x7f7900ffb1e0 outbuf>) (const_int -4294967295 [0xffffffff00000001])))) -1 (nil)) Uros.