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: "ubizjak 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:42:30 +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 #11 from Uros Bizjak <ubizjak at gmail dot com> 2012-02-10 17:42:30 UTC ---
(In reply to comment #9)
> HJ, Steffen, can you please test following patch instead:
val_signbit_known_set_p is a bit overkill, following patch works as well:
--cut here--
Index: i386.c
===================================================================
--- i386.c (revision 184096)
+++ 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)
+ && INTVAL (addr) < 0)
+ return false;
+
if (ix86_decompose_address (addr, &parts) <= 0)
/* Decomposition failed. */
return false;
--cut here--