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
This commit is contained in:
Marek Michalkiewicz 2002-05-25 20:18:53 +02:00 committed by Marek Michalkiewicz
parent ce9e3a6d50
commit b47cae3dee
3 changed files with 36 additions and 1 deletions

View 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.

View 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))
{

View 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)); \