===================================================================
@@ -26,7 +26,6 @@
#include "tm_p.h"
#include "insn-config.h"
#include "regs.h"
-#include "addresses.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "reload.h"
@@ -34,6 +33,7 @@
#include "function.h"
#include "recog.h"
#include "flags.h"
+#include "addresses.h"
#include "toplev.h"
#include "obstack.h"
#include "timevar.h"
===================================================================
@@ -31,10 +31,10 @@ along with GCC; see the file COPYING3.
#include "hard-reg-set.h"
#include "recog.h"
#include "regs.h"
-#include "addresses.h"
#include "expr.h"
#include "function.h"
#include "flags.h"
+#include "addresses.h"
#include "real.h"
#include "toplev.h"
#include "basic-block.h"
===================================================================
@@ -1245,11 +1245,14 @@ enum reg_class
|| reg_classes_intersect_p (VFP_REGS, (CLASS)) \
: 0)
-/* We need to define this for LO_REGS on thumb. Otherwise we can end up
- using r0-r4 for function arguments, r7 for the stack frame and don't
- have enough left over to do doubleword arithmetic. */
+/* We need to define this for LO_REGS on Thumb-1. Otherwise we can end up
+ using r0-r4 for function arguments, r7 for the stack frame and don't have
+ enough left over to do doubleword arithmetic. For Thumb-2 all the
+ potentially problematic instructions accept high registers so this is not
+ necessary. Care needs to be taken to avoid adding new Thumb-2 patterns
+ that require many low registers. */
#define CLASS_LIKELY_SPILLED_P(CLASS) \
- ((TARGET_THUMB && (CLASS) == LO_REGS) \
+ ((TARGET_THUMB1 && (CLASS) == LO_REGS) \
|| (CLASS) == CC_REG)
/* The class value for index registers, and the one for base regs. */
@@ -1260,7 +1263,7 @@ enum reg_class
when addressing quantities in QI or HI mode; if we don't know the
mode, then we must be conservative. */
#define MODE_BASE_REG_CLASS(MODE) \
- (TARGET_32BIT ? CORE_REGS : \
+ (TARGET_ARM || (TARGET_THUMB2 && !optimize_size) ? CORE_REGS : \
(((MODE) == SImode) ? BASE_REGS : LO_REGS))
/* For Thumb we can not support SP+reg addressing, so we return LO_REGS
===================================================================
@@ -26,7 +26,6 @@
#include "tm_p.h"
#include "insn-config.h"
#include "regs.h"
-#include "addresses.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "reload.h"
@@ -34,6 +33,7 @@
#include "function.h"
#include "recog.h"
#include "flags.h"
+#include "addresses.h"
#include "toplev.h"
#include "obstack.h"
#include "timevar.h"