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 #22 from H.J. Lu <hjl.tools at gmail dot com> 2011-08-04 21:03:07 UTC ---
I am testing:

diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index ae1fa74..373e74b 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -844,10 +844,10 @@
   ok = ix86_decompose_address (op, &parts);
   gcc_assert (ok);

-  if (GET_CODE (parts.base) == SUBREG)
+  if (parts.base && GET_CODE (parts.base) == SUBREG)
     parts.base = SUBREG_REG (parts.base);

-  if (GET_CODE (parts.index) == SUBREG)
+  if (parts.index && GET_CODE (parts.index) == SUBREG)
     parts.index = SUBREG_REG (parts.index);

   /* Look for some component that isn't known to be aligned.  */
@@ -914,7 +914,7 @@
   ok = ix86_decompose_address (XEXP (op, 0), &parts);
   gcc_assert (ok);

-  if (GET_CODE (parts.base) == SUBREG)
+  if (parts.base && GET_CODE (parts.base) == SUBREG)
     parts.base = SUBREG_REG (parts.base);

   if (parts.base == NULL_RTX
@@ -924,7 +924,7 @@
       || parts.base == stack_pointer_rtx)
     return true;

-  if (GET_CODE (parts.index) == SUBREG)
+  if (parts.index && GET_CODE (parts.index) == SUBREG)
     parts.index = SUBREG_REG (parts.index);

   if (parts.index == NULL_RTX


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