This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: MN10300: Fix building libstdc++-v3
- From: nick clifton <nickc at redhat dot com>
- To: Jeff Law <law at redhat dot com>, aoliva at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 04 Feb 2014 17:45:42 +0000
- Subject: Re: RFA: MN10300: Fix building libstdc++-v3
- Authentication-results: sourceware.org; auth=none
- References: <87r47k15qd dot fsf at redhat dot com> <52EFD2A6 dot 9090101 at redhat dot com>
Hi Jeff,
But how/why did an extended register get selected to begin with?
It happens in reload.c:find_valid_class().
HARD_REGNO_MODE_OK and other macros/hooks ought to be preventing this
relatively early.
Ah - and that is the problem. mn10300_hard_regno_mode_ok is allowing
extended registers to match some classes even in MN10300.
So how about the patch below ? This also allows the libstdc++-v3
library to be built.
Cheers
Nick
gcc/ChangeLog
2014-02-04 Nick Clifton <nickc@redhat.com>
* config/mn10300/mn10300.c (mn10300_hard_regno_mode_ok): Do not
accept extended registers in any mode when compiling for the
MN10300.
Index: gcc/config/mn10300/mn10300.c
===================================================================
--- gcc/config/mn10300/mn10300.c (revision 207452)
+++ gcc/config/mn10300/mn10300.c (working copy)
@@ -2614,7 +2612,10 @@
|| REGNO_REG_CLASS (regno) == FP_ACC_REGS)
/* Do not store integer values in FP registers. */
return GET_MODE_CLASS (mode) == MODE_FLOAT && ((regno & 1) == 0);
-
+
+ if (! TARGET_AM33 && REGNO_REG_CLASS (regno) == EXTENDED_REGS)
+ return false;
+
if (((regno) & 1) == 0 || GET_MODE_SIZE (mode) == 4)
return true;