This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/52146] [x32] - Wrong code to access addresses 0x80000000 to 0xFFFFFFFF
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Feb 2012 17:28:54 +0000
- Subject: [Bug target/52146] [x32] - Wrong code to access addresses 0x80000000 to 0xFFFFFFFF
- Auto-submitted: auto-generated
- References: <bug-52146-4@http.gcc.gnu.org/bugzilla/>
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.