summaryrefslogtreecommitdiffstats
path: root/gcc/config/avr
diff options
context:
space:
mode:
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-25 13:50:30 +0000
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-25 13:50:30 +0000
commit7104fbe441c54be0c233f8b73d382a9d30d248a0 (patch)
treec84f7ae0b193c87241637a170b833a56dfc1b06d /gcc/config/avr
parent53026b2c98b4059fa91d885bf976d69c27c8967c (diff)
downloadppe42-gcc-7104fbe441c54be0c233f8b73d382a9d30d248a0.tar.gz
ppe42-gcc-7104fbe441c54be0c233f8b73d382a9d30d248a0.zip
* config/avr/avr.c (reg_class_tab): Make local to
avr_regno_reg_class. Return smallest register class available. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/avr')
-rw-r--r--gcc/config/avr/avr.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 649ea0bc89f..7575fc56d2f 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -281,22 +281,6 @@ avr_option_override (void)
init_machine_status = avr_init_machine_status;
}
-/* return register class from register number. */
-
-static const enum reg_class reg_class_tab[]={
- GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,
- GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,
- GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,
- GENERAL_REGS, /* r0 - r15 */
- LD_REGS,LD_REGS,LD_REGS,LD_REGS,LD_REGS,LD_REGS,LD_REGS,
- LD_REGS, /* r16 - 23 */
- ADDW_REGS,ADDW_REGS, /* r24,r25 */
- POINTER_X_REGS,POINTER_X_REGS, /* r26,27 */
- POINTER_Y_REGS,POINTER_Y_REGS, /* r28,r29 */
- POINTER_Z_REGS,POINTER_Z_REGS, /* r30,r31 */
- STACK_REG,STACK_REG /* SPL,SPH */
-};
-
/* Function to set up the backend function structure. */
static struct machine_function *
@@ -310,8 +294,32 @@ avr_init_machine_status (void)
enum reg_class
avr_regno_reg_class (int r)
{
+ static const enum reg_class reg_class_tab[] =
+ {
+ R0_REG,
+ /* r1 - r15 */
+ NO_LD_REGS, NO_LD_REGS, NO_LD_REGS,
+ NO_LD_REGS, NO_LD_REGS, NO_LD_REGS, NO_LD_REGS,
+ NO_LD_REGS, NO_LD_REGS, NO_LD_REGS, NO_LD_REGS,
+ NO_LD_REGS, NO_LD_REGS, NO_LD_REGS, NO_LD_REGS,
+ /* r16 - r23 */
+ SIMPLE_LD_REGS, SIMPLE_LD_REGS, SIMPLE_LD_REGS, SIMPLE_LD_REGS,
+ SIMPLE_LD_REGS, SIMPLE_LD_REGS, SIMPLE_LD_REGS, SIMPLE_LD_REGS,
+ /* r24, r25 */
+ ADDW_REGS, ADDW_REGS,
+ /* X: r26, 27 */
+ POINTER_X_REGS, POINTER_X_REGS,
+ /* Y: r28, r29 */
+ POINTER_Y_REGS, POINTER_Y_REGS,
+ /* Z: r30, r31 */
+ POINTER_Z_REGS, POINTER_Z_REGS,
+ /* SP: SPL, SPH */
+ STACK_REG, STACK_REG
+ };
+
if (r <= 33)
return reg_class_tab[r];
+
return ALL_REGS;
}
OpenPOWER on IntegriCloud