avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL.
authorMarek Michalkiewicz <marekm@amelek.gda.pl>
Sat, 25 May 2002 18:18:53 +0000 (20:18 +0200)
committerMarek Michalkiewicz <marekm@gcc.gnu.org>
Sat, 25 May 2002 18:18:53 +0000 (18:18 +0000)
* config/avr/avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL.

* config/avr/avr.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_BSS): New.

From-SVN: r53872

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

index 124c7e50fabcef3cd42d6b641443be42bf3bde43..8e2c29e69f817122c00f6e7bbefbe967fd39d4d4 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-25  Marek Michalkiewicz  <marekm@amelek.gda.pl>
+
+       * config/avr/avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL.
+
+       * config/avr/avr.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_BSS): New.
+
 2002-05-25  Gabriel Dos Reis  <gdr@codesourcery.com>
 
        * toplev.c (output_clean_symbol_name): Fix another thinko.  Gosh.
index 3ba0eee33a4796a610d332b15dfb5d5674ce7ea9..b254c6ba0273ddd80dd0b112503c479f2ca058ae 100644 (file)
@@ -4683,7 +4683,20 @@ avr_handle_progmem_attribute (node, name, args, flags, no_add_attrs)
 {
   if (DECL_P (*node))
     {
-      if (TREE_STATIC (*node) || DECL_EXTERNAL (*node))
+      if (TREE_CODE (*node) == TYPE_DECL)
+       {
+         /* This is really a decl attribute, not a type attribute,
+            but try to handle it for GCC 3.0 backwards compatibility.  */
+
+         tree type = TREE_TYPE (*node);
+         tree attr = tree_cons (name, args, TYPE_ATTRIBUTES (type));
+         tree newtype = build_type_attribute_variant (type, attr);
+
+         TYPE_MAIN_VARIANT (newtype) = TYPE_MAIN_VARIANT (type);
+         TREE_TYPE (*node) = newtype;
+         *no_add_attrs = true;
+       }
+      else if (TREE_STATIC (*node) || DECL_EXTERNAL (*node))
        {
          if (DECL_INITIAL (*node) == NULL_TREE && !DECL_EXTERNAL (*node))
            {
index ecbc1e5fda91271b200367b7fcc368b8c5e1c47b..77950a72e6ce5e181ec264f1982ed9bde203209f 100644 (file)
@@ -1698,6 +1698,15 @@ do {                                                                         \
    operation to identify the following data as writable initialized
    data.  Normally `"\t.data"' is right.  */
 
+#define BSS_SECTION_ASM_OP "\t.section .bss"
+/* If defined, a C expression whose value is a string, including
+   spacing, containing the assembler operation to identify the
+   following data as uninitialized global data.  If not defined, and
+   neither `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
+   uninitialized global data will be output in the data section if
+   `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
+   used.  */
+
 #define EXTRA_SECTIONS in_progmem
 /* A list of names for sections other than the standard two, which are
    `in_text' and `in_data'.  You need not define this macro on a
@@ -1842,6 +1851,13 @@ do {                                                                        \
    This macro controls how the assembler definitions of uninitialized
    common global variables are output.  */
 
+#define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ROUNDED)                        \
+  asm_output_bss ((FILE), (DECL), (NAME), (SIZE), (ROUNDED))
+/* A C statement (sans semicolon) to output to the stdio stream
+   STREAM the assembler definition of uninitialized global DECL named
+   NAME whose size is SIZE bytes.  The variable ROUNDED is the size
+   rounded up to whatever alignment the caller wants.  */
+
 #define ASM_OUTPUT_LOCAL(STREAM, NAME, SIZE, ROUNDED)                  \
 do {                                                                   \
      fputs ("\t.lcomm ", (STREAM));                                    \