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/49781] [x32] Unnecessary lea in x32 mode


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

--- Comment #20 from Uros Bizjak <ubizjak at gmail dot com> 2011-08-04 20:09:48 UTC ---
This is the missing part of predicates.md:

Index: predicates.md
===================================================================
--- predicates.md    (revision 177411)
+++ predicates.md    (working copy)
@@ -840,6 +844,12 @@
   ok = ix86_decompose_address (op, &parts);
   gcc_assert (ok);

+  if (GET_CODE (parts.base) == SUBREG)
+    parts.base = SUBREG_REG (parts.base);
+
+  if (GET_CODE (parts.index) == SUBREG)
+    parts.index = SUBREG_REG (parts.index);
+
   /* Look for some component that isn't known to be aligned.  */
   if (parts.index)
     {
@@ -903,6 +913,10 @@

   ok = ix86_decompose_address (XEXP (op, 0), &parts);
   gcc_assert (ok);
+
+  if (GET_CODE (parts.base) == SUBREG)
+    parts.base = SUBREG_REG (parts.base);
+
   if (parts.base == NULL_RTX
       || parts.base == arg_pointer_rtx
       || parts.base == frame_pointer_rtx
@@ -910,6 +924,9 @@
       || parts.base == stack_pointer_rtx)
     return true;

+  if (GET_CODE (parts.index) == SUBREG)
+    parts.index = SUBREG_REG (parts.index);
+
   if (parts.index == NULL_RTX
       || parts.index == arg_pointer_rtx
       || parts.index == frame_pointer_rtx


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