This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/52146] [x32] - Wrong code to access addresses 0x80000000 to 0xFFFFFFFF


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--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]