http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52146

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> 2012-02-10 17:28:54 
UTC ---
(In reply to comment #9)
> HJ, Steffen, can you please test following patch instead:
> 
> --cut here--
> Index: i386/i386.c
> ===================================================================
> --- i386/i386.c (revision 184096)
> +++ i386/i386.c (working copy)
> @@ -11932,6 +11932,13 @@ ix86_legitimate_address_p (enum machine_mode mode
>    rtx base, index, disp;
>    HOST_WIDE_INT scale;
> 
> +  /* Since constant address in x32 is signed extended to 64bit,
> +     we have to prevent addresses from 0x80000000 to 0xffffffff.  */
> +  if (TARGET_X32
> +      && CONST_INT_P (addr)
> +      && val_signbit_known_set_p (SImode, INTVAL (addr)))
> +    return false;
> +
>    if (ix86_decompose_address (addr, &parts) <= 0)
>      /* Decomposition failed.  */
>      return false;
> --cut here--

It works.

Reply via email to