summaryrefslogtreecommitdiff
path: root/gcc/config/cris
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-12 21:35:19 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-12 21:35:19 +0000
commita3ed3761ca3501faa64e92e7e38d32fdb146a0ff (patch)
treeba5ea342196989db654db06103cbefccccbe76fc /gcc/config/cris
parent64c0b1493f1490fe1a0171227b57429410dc15f2 (diff)
downloadgcc-a3ed3761ca3501faa64e92e7e38d32fdb146a0ff.tar.gz
2011-10-12 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 179863 using svnmerge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@179867 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/cris')
-rw-r--r--gcc/config/cris/cris.c30
-rw-r--r--gcc/config/cris/cris.h16
2 files changed, 30 insertions, 16 deletions
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index b74bbd3c482..35ecaa8e2fd 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -123,6 +123,8 @@ static void cris_asm_output_mi_thunk
static void cris_file_start (void);
static void cris_init_libfuncs (void);
+static reg_class_t cris_preferred_reload_class (rtx, reg_class_t);
+
static int cris_register_move_cost (enum machine_mode, reg_class_t, reg_class_t);
static int cris_memory_move_cost (enum machine_mode, reg_class_t, bool);
static bool cris_rtx_costs (rtx, int, int, int, int *, bool);
@@ -198,6 +200,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS cris_init_libfuncs
+#undef TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS cris_preferred_reload_class
+
#undef TARGET_REGISTER_MOVE_COST
#define TARGET_REGISTER_MOVE_COST cris_register_move_cost
#undef TARGET_MEMORY_MOVE_COST
@@ -1342,6 +1347,31 @@ cris_reload_address_legitimized (rtx x,
return false;
}
+
+/* Worker function for TARGET_PREFERRED_RELOAD_CLASS.
+
+ It seems like gcc (2.7.2 and 2.9x of 2000-03-22) may send "NO_REGS" as
+ the class for a constant (testcase: __Mul in arit.c). To avoid forcing
+ out a constant into the constant pool, we will trap this case and
+ return something a bit more sane. FIXME: Check if this is a bug.
+ Beware that we must not "override" classes that can be specified as
+ constraint letters, or else asm operands using them will fail when
+ they need to be reloaded. FIXME: Investigate whether that constitutes
+ a bug. */
+
+static reg_class_t
+cris_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, reg_class_t rclass)
+{
+ if (rclass != ACR_REGS
+ && rclass != MOF_REGS
+ && rclass != SRP_REGS
+ && rclass != CC0_REGS
+ && rclass != SPECIAL_REGS)
+ return GENERAL_REGS;
+
+ return rclass;
+}
+
/* Worker function for TARGET_REGISTER_MOVE_COST. */
static int
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index a18b14ef21e..4c28e4530ab 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -583,22 +583,6 @@ enum reg_class
/* See REGNO_OK_FOR_BASE_P. */
#define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO)
-/* It seems like gcc (2.7.2 and 2.9x of 2000-03-22) may send "NO_REGS" as
- the class for a constant (testcase: __Mul in arit.c). To avoid forcing
- out a constant into the constant pool, we will trap this case and
- return something a bit more sane. FIXME: Check if this is a bug.
- Beware that we must not "override" classes that can be specified as
- constraint letters, or else asm operands using them will fail when
- they need to be reloaded. FIXME: Investigate whether that constitutes
- a bug. */
-#define PREFERRED_RELOAD_CLASS(X, CLASS) \
- ((CLASS) != ACR_REGS \
- && (CLASS) != MOF_REGS \
- && (CLASS) != SRP_REGS \
- && (CLASS) != CC0_REGS \
- && (CLASS) != SPECIAL_REGS \
- ? GENERAL_REGS : (CLASS))
-
/* We can't move special registers to and from memory in smaller than
word_mode. We also can't move between special registers. Luckily,
-1, as returned by true_regnum for non-sub/registers, is valid as a