Patchwork [committed] Fix PR target/56214

login
register
mail settings
Submitter John David Anglin
Date Feb. 18, 2013, 3:38 p.m.
Message ID <20130218153843.GA2139@hiauly1.hia.nrc.ca>
Download mbox | patch
Permalink /patch/221402/
State New
Headers show

Comments

John David Anglin - Feb. 18, 2013, 3:38 p.m.
The attached change fixes PR target/56214.  We need to reject everything
but QImode and HImode when reload is in progress and strict is specified.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.  Committed to
trunk.

Dave

Patch

Index: config/pa/predicates.md
===================================================================
--- config/pa/predicates.md	(revision 196102)
+++ config/pa/predicates.md	(working copy)
@@ -272,22 +272,13 @@ 
      assumed in the instruction encoding.  */
   switch (mode)
     {
+    case BLKmode:
     case QImode:
     case HImode:
       return true;
 
-    case SImode:
-    case SFmode:
-    case SCmode:
-      return (INTVAL (op) % 4) == 0;
-
-    case DImode:
-    case DFmode:
-    case DCmode:
-      return (INTVAL (op) % 8) == 0;
-
     default:
-      break;
+      return (INTVAL (op) % GET_MODE_SIZE (mode)) == 0;
     }
 
   return false;
Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c	(revision 196102)
+++ config/pa/pa.c	(working copy)
@@ -10517,21 +10532,13 @@ 
 	     the majority of accesses will use floating point instructions
 	     that don't support 14-bit offsets.  */
 	  if (!INT14_OK_STRICT
-	      && (GET_MODE_CLASS (mode) == MODE_FLOAT
-		  || (reload_in_progress
-		      && strict
-		      && (mode == SImode || mode == DImode))))
-	   return false;
+	      && reload_in_progress
+	      && strict
+	      && mode != QImode
+	      && mode != HImode)
+	    return false;
 
-	  if (INT_14_BITS (index)
-	      && (mode == BLKmode
-		  || mode == QImode
-		  || mode == HImode
-		  /* Displacement must be a multiple of its size.  */
-		  || (INTVAL (index) % GET_MODE_SIZE (mode)) == 0))
-	    return true;
-
-	  return false;
+	  return base14_operand (index, mode);
 	}
 
       if (!TARGET_DISABLE_INDEXING
@@ -10586,11 +10593,11 @@ 
 	    return true;
 
 	  if (!INT14_OK_STRICT
-	      && (GET_MODE_CLASS (mode) == MODE_FLOAT
-		  || (reload_in_progress
-		      && strict
-		      && (mode == SImode || mode == DImode))))
-	   return false;
+	      && reload_in_progress
+	      && strict
+	      && mode != QImode
+	      && mode != HImode)
+	    return false;
 
 	  if (CONSTANT_P (XEXP (x, 1)))
 	    return true;