Patchwork [x32] PATCH: Check SUBREG_REG for parts.index and parts.base

login
register
mail settings
Submitter H.J. Lu
Date March 6, 2011, 7:18 p.m.
Message ID <20110306191846.GA21150@intel.com>
Download mbox | patch
Permalink /patch/85589/
State New
Headers show

Comments

H.J. Lu - March 6, 2011, 7:18 p.m.
Hi,

X32 may use SUBREG_REG in parts.index and parts.base.  I checked
this patch into x32 branch.


H.J.
---
commit e2f00cf7ffb008eb4710221853d82fa1b81433e0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Mar 6 11:14:50 2011 -0800

    Check SUBREG_REG for parts.index and parts.base.

Patch

diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32
index 0fae773..f39563b 100644
--- a/gcc/ChangeLog.x32
+++ b/gcc/ChangeLog.x32
@@ -1,5 +1,10 @@ 
 2011-03-06  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* config/i386/predicates.md (aligned_operand): Check SUBREG_REG
+	for parts.index and parts.base.
+
+2011-03-06  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* config/i386/i386.c (ix86_expand_call): Convert function address
 	to Pmode if needed.
 
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 55a04e3..4bd5688 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -853,11 +853,15 @@ 
   /* Look for some component that isn't known to be aligned.  */
   if (parts.index)
     {
+      if (GET_CODE (parts.index) == SUBREG)
+	parts.index = SUBREG_REG (parts.index);
       if (REGNO_POINTER_ALIGN (REGNO (parts.index)) * parts.scale < 32)
 	return false;
     }
   if (parts.base)
     {
+      if (GET_CODE (parts.base) == SUBREG)
+	parts.base = SUBREG_REG (parts.base);
       if (REGNO_POINTER_ALIGN (REGNO (parts.base)) < 32)
 	return false;
     }