===================================================================
@@ -113,6 +113,7 @@ static int class_contents[LIM_REG_CLASSE
/* These are all to support encode_pattern(). */
static char pattern[30], *patternp;
static GTY(()) rtx patternr[30];
+static bool address_pattern_p;
#define RTX_IS(x) (streq (pattern, x))
/* Some macros to simplify the logic throughout this file. */
@@ -166,8 +167,9 @@ encode_pattern_1 (rtx x)
*patternp++ = 'r';
break;
case SUBREG:
- if (GET_MODE_SIZE (GET_MODE (x)) !=
- GET_MODE_SIZE (GET_MODE (XEXP (x, 0))))
+ if (address_pattern_p
+ || (GET_MODE_SIZE (GET_MODE (x))
+ != GET_MODE_SIZE (GET_MODE (XEXP (x, 0)))))
*patternp++ = 'S';
encode_pattern_1 (XEXP (x, 0));
break;
@@ -254,9 +256,10 @@ encode_pattern_1 (rtx x)
}
static void
-encode_pattern (rtx x)
+encode_pattern (rtx x, bool address_p = false)
{
patternp = pattern;
+ address_pattern_p = address_p;
encode_pattern_1 (x);
*patternp = 0;
}
@@ -1684,7 +1687,7 @@ m32c_legitimate_address_p (enum machine_
}
#endif
- encode_pattern (x);
+ encode_pattern (x, true);
if (RTX_IS ("r"))
{
/* Most indexable registers can be used without displacements,