avr.c (avr_base_arch_macro, [...]): Remove variables.
authorAnatoly Sokolov <aesok@post.ru>
Thu, 15 May 2008 21:07:38 +0000 (01:07 +0400)
committerAnatoly Sokolov <aesok@gcc.gnu.org>
Thu, 15 May 2008 21:07:38 +0000 (01:07 +0400)
* config/avr/avr.c (avr_base_arch_macro, avr_have_movw_lpmx_p,
avr_have_mul_p, avr_asm_only_p): Remove variables.
(avr_override_options): Remove initialization of removed variables.
(avr_file_start):  Convert removed variables to fields of
'struct base_arch_s *avr_current_arch'.
* config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): (Ditto.).
(AVR_HAVE_MUL): (Ditto.).
(AVR_HAVE_MOVW): (Ditto.).
(AVR_HAVE_LPMX): (Ditto.).
(avr_base_arch_macro, avr_have_movw_lpmx_p, avr_have_mul_p,
avr_asm_only_p): Remove declaration.

From-SVN: r135396

gcc/ChangeLog
gcc/config/avr/avr.c
gcc/config/avr/avr.h

index 3d892f63f2f171a2318e9ccc8ed05ffa3c61e8de..d5f25c9edc3a155f41933f467ad8430d28b609f7 100644 (file)
@@ -1,3 +1,17 @@
+2008-05-15  Anatoly Sokolov <aesok@post.ru>
+
+       * config/avr/avr.c (avr_base_arch_macro, avr_have_movw_lpmx_p, 
+       avr_have_mul_p, avr_asm_only_p): Remove variables.
+       (avr_override_options): Remove initialization of removed variables.
+       (avr_file_start):  Convert removed variables to fields of 
+       'struct base_arch_s *avr_current_arch'. 
+       * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): (Ditto.).
+       (AVR_HAVE_MUL): (Ditto.).
+       (AVR_HAVE_MOVW): (Ditto.).
+       (AVR_HAVE_LPMX): (Ditto.). 
+       (avr_base_arch_macro, avr_have_movw_lpmx_p, avr_have_mul_p, 
+       avr_asm_only_p): Remove declaration.
+
 2008-05-15  Diego Novillo  <dnovillo@google.com>
 
        * config/arm/arm.c (arm_return_in_memory): Fix return
index e1d77758c3cdcf8ad189384787bc63e4e122402d..9a860533e9a576894e82b25e1ae2645f7673680c 100644 (file)
@@ -97,7 +97,6 @@ static const char *const avr_regnames[] = REGISTER_NAMES;
 static int last_insn_address = 0;
 
 /* Preprocessor macros to define depending on MCU type.  */
-const char *avr_base_arch_macro;
 const char *avr_extra_arch_macro;
 
 /* Current architecture.  */
@@ -105,15 +104,6 @@ const struct base_arch_s *avr_current_arch;
 
 section *progmem_section;
 
-/* Core have 'MUL*' instructions.  */
-int avr_have_mul_p = 0;
-
-/* Assembler only.  */
-int avr_asm_only_p = 0;
-
-/* Core have 'MOVW' and 'LPM Rx,Z' instructions.  */
-int avr_have_movw_lpmx_p = 0;
-
 static const struct base_arch_s avr_arch_types[] = {
   { 1, 0, 0, 0, 0, 0, 0, 0, NULL },  /* unknown device specified */
   { 1, 0, 0, 0, 0, 0, 0, 0, "__AVR_ARCH__=1"   },
@@ -337,7 +327,6 @@ void
 avr_override_options (void)
 {
   const struct mcu_type_s *t;
-  const struct base_arch_s *base;
 
   flag_delete_null_pointer_checks = 0;
 
@@ -354,11 +343,6 @@ avr_override_options (void)
     }
 
   avr_current_arch = &avr_arch_types[t->arch];
-  base = &avr_arch_types[t->arch];
-  avr_asm_only_p = base->asm_only;
-  avr_have_mul_p = base->have_mul;
-  avr_have_movw_lpmx_p = base->have_movw_lpmx;
-  avr_base_arch_macro = base->macro;
   avr_extra_arch_macro = t->macro;
 
   if (optimize && !TARGET_NO_TABLEJUMP)
@@ -4812,7 +4796,7 @@ avr_section_type_flags (tree decl, const char *name, int reloc)
 static void
 avr_file_start (void)
 {
-  if (avr_asm_only_p)
+  if (avr_current_arch->asm_only)
     error ("MCU %qs supported for assembler only", avr_mcu_name);
 
   default_file_start ();
index 1f2ea7a960015ba0d747080b8ec81d8dcf69ff4e..5261d9d6ba547939762a9c413a315098d5401eef 100644 (file)
@@ -56,8 +56,8 @@ extern const struct base_arch_s *avr_current_arch;
   do                                           \
     {                                          \
       builtin_define_std ("AVR");              \
-      if (avr_base_arch_macro)                 \
-       builtin_define (avr_base_arch_macro);   \
+      if (avr_current_arch->macro)             \
+       builtin_define (avr_current_arch->macro);       \
       if (avr_extra_arch_macro)                        \
        builtin_define (avr_extra_arch_macro);  \
       if (avr_current_arch->have_elpm)         \
@@ -66,20 +66,23 @@ extern const struct base_arch_s *avr_current_arch;
        builtin_define ("__AVR_HAVE_ELPM__");   \
       if (avr_current_arch->have_elpmx)                \
        builtin_define ("__AVR_HAVE_ELPMX__");  \
-      if (avr_have_movw_lpmx_p)                        \
-       builtin_define ("__AVR_HAVE_MOVW__");   \
-      if (avr_have_movw_lpmx_p)                        \
-       builtin_define ("__AVR_HAVE_LPMX__");   \
-      if (avr_asm_only_p)                      \
+      if (avr_current_arch->have_movw_lpmx)    \
+       {                                       \
+         builtin_define ("__AVR_HAVE_MOVW__"); \
+         builtin_define ("__AVR_HAVE_LPMX__"); \
+       }                                       \
+      if (avr_current_arch->asm_only)          \
        builtin_define ("__AVR_ASM_ONLY__");    \
-      if (avr_have_mul_p)                      \
-       builtin_define ("__AVR_ENHANCED__");    \
-      if (avr_have_mul_p)                      \
-       builtin_define ("__AVR_HAVE_MUL__");    \
-      if (avr_current_arch->have_jmp_call)     \
-       builtin_define ("__AVR_MEGA__");        \
+      if (avr_current_arch->have_mul)          \
+       {                                       \
+         builtin_define ("__AVR_ENHANCED__");  \
+         builtin_define ("__AVR_HAVE_MUL__");  \
+       }                                       \
       if (avr_current_arch->have_jmp_call)     \
-       builtin_define ("__AVR_HAVE_JMP_CALL__"); \
+       {                                       \
+         builtin_define ("__AVR_MEGA__");      \
+         builtin_define ("__AVR_HAVE_JMP_CALL__");     \
+       }                                       \
       if (avr_current_arch->have_eijmp_eicall) \
         {                                      \
          builtin_define ("__AVR_HAVE_EIJMP_EICALL__"); \
@@ -94,19 +97,16 @@ extern const struct base_arch_s *avr_current_arch;
     }                                          \
   while (0)
 
-extern const char *avr_base_arch_macro;
 extern const char *avr_extra_arch_macro;
-extern int avr_have_mul_p;
-extern int avr_asm_only_p;
-extern int avr_have_movw_lpmx_p;
+
 #if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)
 extern GTY(()) section *progmem_section;
 #endif
 
 #define AVR_HAVE_JMP_CALL (avr_current_arch->have_jmp_call && !TARGET_SHORT_CALLS)
-#define AVR_HAVE_MUL (avr_have_mul_p)
-#define AVR_HAVE_MOVW (avr_have_movw_lpmx_p)
-#define AVR_HAVE_LPMX (avr_have_movw_lpmx_p)
+#define AVR_HAVE_MUL (avr_current_arch->have_mul)
+#define AVR_HAVE_MOVW (avr_current_arch->have_movw_lpmx)
+#define AVR_HAVE_LPMX (avr_current_arch->have_movw_lpmx)
 #define AVR_HAVE_RAMPZ (avr_current_arch->have_elpm)
 #define AVR_HAVE_EIJMP_EICALL (avr_current_arch->have_eijmp_eicall)