diff options
author | Marek Michalkiewicz <marekm@amelek.gda.pl> | 2002-05-25 20:18:53 +0200 |
---|---|---|
committer | Marek Michalkiewicz <marekm@gcc.gnu.org> | 2002-05-25 18:18:53 +0000 |
commit | b47cae3dee210a9b985e18e2b6211ea8ce9c5d88 (patch) | |
tree | 11831a1f21939e3fc7f9bd074d76d61202b9b5ab /gcc | |
parent | ce9e3a6d50ad5a4a3ed6631781d3cb40153957e2 (diff) | |
download | gcc-b47cae3dee210a9b985e18e2b6211ea8ce9c5d88.zip gcc-b47cae3dee210a9b985e18e2b6211ea8ce9c5d88.tar.gz gcc-b47cae3dee210a9b985e18e2b6211ea8ce9c5d88.tar.bz2 |
avr.c (avr_handle_progmem_attribute): Handle TYPE_DECL.
* 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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/avr/avr.c | 15 | ||||
-rw-r--r-- | gcc/config/avr/avr.h | 16 |
3 files changed, 36 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 124c7e5..8e2c29e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 3ba0eee..b254c6b 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -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)) { diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index ecbc1e5..77950a7 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -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)); \ |