diff mbox

[AVR,Committed] Hookize CLASS_LIKELY_SPILLED_P

Message ID 759324602.20100923223243@post.ru
State New
Headers show

Commit Message

Anatoly Sokolov Sept. 23, 2010, 6:32 p.m. UTC
Hi.

  This patch removes obsolete CLASS_LIKELY_SPILLED_P macro from the AVR back
end in the GCC and introduces equivalent TARGET_CLASS_LIKELY_SPILLED_P target
hook.

  Committed.

        * config/avr/avr.h (CLASS_LIKELY_SPILLED_P): Remove.
        * config/avr/avr-protos.h (class_likely_spilled_p): Remove.
        * config/avr/avr.c (TARGET_CLASS_LIKELY_SPILLED_P): Define.
        (class_likely_spilled_p): Rename to...
        (avr_class_likely_spilled_p): ...this. Make static. Change argument
        type to reg_class_t.



Anatoly.
diff mbox

Patch

Index: gcc/config/avr/avr-protos.h
===================================================================
--- gcc/config/avr/avr-protos.h	(revision 164568)
+++ gcc/config/avr/avr-protos.h	(working copy)
@@ -24,7 +24,6 @@ 
 extern int function_arg_regno_p (int r);
 extern void avr_cpu_cpp_builtins (struct cpp_reader * pfile);
 extern int avr_ret_register (void);
-extern bool class_likely_spilled_p (int c);
 extern enum reg_class avr_regno_reg_class (int r);
 extern void asm_globalize_label (FILE *file, const char *name);
 extern void avr_asm_declare_function_name (FILE *, const char *, tree);
Index: gcc/config/avr/avr.c
===================================================================
--- gcc/config/avr/avr.c        (revision 164568)
+++ gcc/config/avr/avr.c        (working copy)
@@ -92,6 +92,7 @@ 
 static unsigned int avr_case_values_threshold (void);
 static bool avr_frame_pointer_required_p (void);
 static bool avr_can_eliminate (const int, const int);
+static bool avr_class_likely_spilled_p (reg_class_t c);
 
 /* Allocate registers from r25 to r8 for parameters for function calls.  */
 #define FIRST_CUM_REG 26
@@ -193,6 +194,9 @@ 
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE avr_can_eliminate
 
+#undef TARGET_CLASS_LIKELY_SPILLED_P
+#define TARGET_CLASS_LIKELY_SPILLED_P avr_class_likely_spilled_p
+
 #undef TARGET_OPTION_OVERRIDE
 #define TARGET_OPTION_OVERRIDE avr_option_override
 
@@ -4762,8 +4766,8 @@ 
    assigned to registers of class CLASS would likely be spilled
    because registers of CLASS are needed for spill registers.  */
 
-bool
-class_likely_spilled_p (int c)
+static bool
+avr_class_likely_spilled_p (reg_class_t c)
 {
   return (c != ALL_REGS && c != ADDW_REGS);
 }
Index: gcc/config/avr/avr.h
===================================================================
--- gcc/config/avr/avr.h        (revision 164568)
+++ gcc/config/avr/avr.h        (working copy)
@@ -333,8 +333,6 @@ 
 
 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
 
-#define CLASS_LIKELY_SPILLED_P(c) class_likely_spilled_p(c)
-
 #define CLASS_MAX_NREGS(CLASS, MODE)   class_max_nregs (CLASS, MODE)
 
 #define STACK_PUSH_CODE POST_DEC