2011/4/6 Anatoly Sokolov <ae...@post.ru>:
> Hi.
>
>  No one back end does not use ASM_OUTPUT_BSS macro now, this patch remove it.
> The GCC have more flexible ASM_OUTPUT_ALIGNED_BSS macro.
>
>  The patch has been bootstrapped on and regression tested on
> x86_64-unknown-linux-gnu for c.
>
>  OK to install?

Ok.

Thanks,
Richard.

>        * doc/tm.texi.in (ASM_OUTPUT_BSS): Remove documentation.
>        (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS): Update documentation.
>        * doc/tm.texi: Regenerate.
>        * system.h (ASM_OUTPUT_BSS): Poison.
>        * varasm.c (asm_output_bss): Remove function.
>        (emit_bss, init_varasm_once): Don't use ASM_OUTPUT_BSS macro.
>
>        * config/frv/frv.h (BSS_SECTION_ASM_OP): Remove comment.
>        * config/frv/fr30.h (BSS_SECTION_ASM_OP): Likewise.
>        * config/i386/djgpp.h (BSS_SECTION_ASM_OP): Likewise.
>        * config/i386/i386elf.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS):
>        Likewise.
>        * config/sh/sh.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS):
>        Likewise.
>        * config/m68k/m68kelf.h (BSS_SECTION_ASM_OP, ASM_OUTPUT_ALIGNED_BSS):
>        Likewise.
>        * config/m68k/netbsd-elf.h (ASM_OUTPUT_ALIGNED_BSS): Likewise.
>
>
> Index: gcc/doc/tm.texi
> ===================================================================
> --- gcc/doc/tm.texi     (revision 172058)
> +++ gcc/doc/tm.texi     (working copy)
> @@ -6821,8 +6821,8 @@
>  @defmac BSS_SECTION_ASM_OP
>  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
> -@code{ASM_OUTPUT_BSS} nor @code{ASM_OUTPUT_ALIGNED_BSS} are defined,
> +uninitialized global data.  If not defined, and
> +@code{ASM_OUTPUT_ALIGNED_BSS} not defined,
>  uninitialized global data will be output in the data section if
>  @option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
>  used.
> @@ -7598,20 +7598,19 @@
>  the variable's decl in order to chose what to output.
>  @end defmac
>
> -@defmac ASM_OUTPUT_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, 
> @var{rounded})
> +@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, 
> @var{size}, @var{alignment})
>  A C statement (sans semicolon) to output to the stdio stream
>  @var{stream} the assembler definition of uninitialized global @var{decl} 
> named
> -@var{name} whose size is @var{size} bytes.  The variable @var{rounded}
> -is the size rounded up to whatever alignment the caller wants.
> +@var{name} whose size is @var{size} bytes.  The variable @var{alignment}
> +is the alignment specified as the number of bits.
>
> -Try to use function @code{asm_output_bss} defined in @file{varasm.c} when
> -defining this macro.  If unable, use the expression
> +Try to use function @code{asm_output_aligned_bss} defined in file
> +@file{varasm.c} when defining this macro.  If unable, use the expression
>  @code{assemble_name (@var{stream}, @var{name})} to output the name itself;
>  before and after that, output the additional assembler syntax for defining
>  the name, and a newline.
>
> -There are two ways of handling global BSS@.  One is to define either
> -this macro or its aligned counterpart, @code{ASM_OUTPUT_ALIGNED_BSS}.
> +There are two ways of handling global BSS@.  One is to define this macro.
>  The other is to have @code{TARGET_ASM_SELECT_SECTION} return a
>  switchable BSS section (@pxref{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS}).
>  You do not need to do both.
> @@ -7623,17 +7622,6 @@
>  common in order to save space in the object file.
>  @end defmac
>
> -@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, 
> @var{size}, @var{alignment})
> -Like @code{ASM_OUTPUT_BSS} except takes the required alignment as a
> -separate, explicit argument.  If you define this macro, it is used in
> -place of @code{ASM_OUTPUT_BSS}, and gives you more flexibility in
> -handling the required alignment of the variable.  The alignment is specified
> -as the number of bits.
> -
> -Try to use function @code{asm_output_aligned_bss} defined in file
> -@file{varasm.c} when defining this macro.
> -@end defmac
> -
>  @defmac ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, 
> @var{rounded})
>  A C statement (sans semicolon) to output to the stdio stream
>  @var{stream} the assembler definition of a local-common-label named
> Index: gcc/doc/tm.texi.in
> ===================================================================
> --- gcc/doc/tm.texi.in  (revision 172058)
> +++ gcc/doc/tm.texi.in  (working copy)
> @@ -6799,8 +6799,8 @@
>  @defmac BSS_SECTION_ASM_OP
>  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
> -@code{ASM_OUTPUT_BSS} nor @code{ASM_OUTPUT_ALIGNED_BSS} are defined,
> +uninitialized global data.  If not defined, and
> +@code{ASM_OUTPUT_ALIGNED_BSS} not defined,
>  uninitialized global data will be output in the data section if
>  @option{-fno-common} is passed, otherwise @code{ASM_OUTPUT_COMMON} will be
>  used.
> @@ -7564,20 +7564,19 @@
>  the variable's decl in order to chose what to output.
>  @end defmac
>
> -@defmac ASM_OUTPUT_BSS (@var{stream}, @var{decl}, @var{name}, @var{size}, 
> @var{rounded})
> +@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, 
> @var{size}, @var{alignment})
>  A C statement (sans semicolon) to output to the stdio stream
>  @var{stream} the assembler definition of uninitialized global @var{decl} 
> named
> -@var{name} whose size is @var{size} bytes.  The variable @var{rounded}
> -is the size rounded up to whatever alignment the caller wants.
> +@var{name} whose size is @var{size} bytes.  The variable @var{alignment}
> +is the alignment specified as the number of bits.
>
> -Try to use function @code{asm_output_bss} defined in @file{varasm.c} when
> -defining this macro.  If unable, use the expression
> +Try to use function @code{asm_output_aligned_bss} defined in file
> +@file{varasm.c} when defining this macro.  If unable, use the expression
>  @code{assemble_name (@var{stream}, @var{name})} to output the name itself;
>  before and after that, output the additional assembler syntax for defining
>  the name, and a newline.
>
> -There are two ways of handling global BSS@.  One is to define either
> -this macro or its aligned counterpart, @code{ASM_OUTPUT_ALIGNED_BSS}.
> +There are two ways of handling global BSS@.  One is to define this macro.
>  The other is to have @code{TARGET_ASM_SELECT_SECTION} return a
>  switchable BSS section (@pxref{TARGET_HAVE_SWITCHABLE_BSS_SECTIONS}).
>  You do not need to do both.
> @@ -7589,17 +7588,6 @@
>  common in order to save space in the object file.
>  @end defmac
>
> -@defmac ASM_OUTPUT_ALIGNED_BSS (@var{stream}, @var{decl}, @var{name}, 
> @var{size}, @var{alignment})
> -Like @code{ASM_OUTPUT_BSS} except takes the required alignment as a
> -separate, explicit argument.  If you define this macro, it is used in
> -place of @code{ASM_OUTPUT_BSS}, and gives you more flexibility in
> -handling the required alignment of the variable.  The alignment is specified
> -as the number of bits.
> -
> -Try to use function @code{asm_output_aligned_bss} defined in file
> -@file{varasm.c} when defining this macro.
> -@end defmac
> -
>  @defmac ASM_OUTPUT_LOCAL (@var{stream}, @var{name}, @var{size}, 
> @var{rounded})
>  A C statement (sans semicolon) to output to the stdio stream
>  @var{stream} the assembler definition of a local-common-label named
> Index: gcc/varasm.c
> ===================================================================
> --- gcc/varasm.c        (revision 172058)
> +++ gcc/varasm.c        (working copy)
> @@ -121,10 +121,6 @@
>  static void globalize_decl (tree);
>  static bool decl_readonly_section_1 (enum section_category);
>  #ifdef BSS_SECTION_ASM_OP
> -#ifdef ASM_OUTPUT_BSS
> -static void asm_output_bss (FILE *, tree, const char *,
> -                           unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT);
> -#endif
>  #ifdef ASM_OUTPUT_ALIGNED_BSS
>  static void asm_output_aligned_bss (FILE *, tree, const char *,
>                                    unsigned HOST_WIDE_INT, int)
> @@ -427,34 +423,6 @@
>
>  #ifdef BSS_SECTION_ASM_OP
>
> -#ifdef ASM_OUTPUT_BSS
> -
> -/* Utility function for ASM_OUTPUT_BSS for targets to use if
> -   they don't support alignments in .bss.
> -   ??? It is believed that this function will work in most cases so such
> -   support is localized here.  */
> -
> -static void ATTRIBUTE_UNUSED
> -asm_output_bss (FILE *file, tree decl ATTRIBUTE_UNUSED,
> -               const char *name,
> -               unsigned HOST_WIDE_INT size ATTRIBUTE_UNUSED,
> -               unsigned HOST_WIDE_INT rounded)
> -{
> -  gcc_assert (strcmp (XSTR (XEXP (DECL_RTL (decl), 0), 0), name) == 0);
> -  targetm.asm_out.globalize_decl_name (file, decl);
> -  switch_to_section (bss_section);
> -#ifdef ASM_DECLARE_OBJECT_NAME
> -  last_assemble_variable_decl = decl;
> -  ASM_DECLARE_OBJECT_NAME (file, name, decl);
> -#else
> -  /* Standard thing is just output label for the object.  */
> -  ASM_OUTPUT_LABEL (file, name);
> -#endif /* ASM_DECLARE_OBJECT_NAME */
> -  ASM_OUTPUT_SKIP (file, rounded ? rounded : 1);
> -}
> -
> -#endif
> -
>  #ifdef ASM_OUTPUT_ALIGNED_BSS
>
>  /* Utility function for targets to use in implementing
> @@ -1795,7 +1763,7 @@
>
>  /* A noswitch_section_callback for bss_noswitch_section.  */
>
> -#if defined ASM_OUTPUT_ALIGNED_BSS || defined ASM_OUTPUT_BSS
> +#if defined ASM_OUTPUT_ALIGNED_BSS
>  static bool
>  emit_bss (tree decl ATTRIBUTE_UNUSED,
>          const char *name ATTRIBUTE_UNUSED,
> @@ -1805,9 +1773,6 @@
>  #if defined ASM_OUTPUT_ALIGNED_BSS
>   ASM_OUTPUT_ALIGNED_BSS (asm_out_file, decl, name, size, DECL_ALIGN (decl));
>   return true;
> -#else
> -  ASM_OUTPUT_BSS (asm_out_file, decl, name, size, rounded);
> -  return false;
>  #endif
>  }
>  #endif
> @@ -6004,7 +5969,7 @@
>   comm_section = get_noswitch_section (SECTION_WRITE | SECTION_BSS
>                                       | SECTION_COMMON, emit_common);
>
> -#if defined ASM_OUTPUT_ALIGNED_BSS || defined ASM_OUTPUT_BSS
> +#if defined ASM_OUTPUT_ALIGNED_BSS
>   bss_noswitch_section = get_noswitch_section (SECTION_WRITE | SECTION_BSS,
>                                               emit_bss);
>  #endif
> Index: gcc/system.h
> ===================================================================
> --- gcc/system.h        (revision 172058)
> +++ gcc/system.h        (working copy)
> @@ -830,7 +830,7 @@
>        FUNCTION_ARG_BOUNDARY MUST_USE_SJLJ_EXCEPTIONS US_SOFTWARE_GOFAST  \
>        USING_SVR4_H SVR4_ASM_SPEC FUNCTION_ARG FUNCTION_ARG_ADVANCE       \
>        FUNCTION_INCOMING_ARG IRA_COVER_CLASSES TARGET_VERSION             \
> -       MACHINE_TYPE TARGET_HAS_TARGETCM
> +       MACHINE_TYPE TARGET_HAS_TARGETCM ASM_OUTPUT_BSS
>
>  /* Hooks that are no longer used.  */
>  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE  \
> Index: gcc/config/frv/frv.h
> ===================================================================
> --- gcc/config/frv/frv.h        (revision 172058)
> +++ gcc/config/frv/frv.h        (working copy)
> @@ -1574,13 +1574,6 @@
>    `".data"' is right.  */
>  #define DATA_SECTION_ASM_OP "\t.data"
>
> -/* If defined, a C expression whose value is a string 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 BSS_SECTION_ASM_OP "\t.section .bss,\"aw\""
>
>  /* Short Data Support */
> Index: gcc/config/i386/djgpp.h
> ===================================================================
> --- gcc/config/i386/djgpp.h     (revision 172058)
> +++ gcc/config/i386/djgpp.h     (working copy)
> @@ -24,13 +24,6 @@
>  /* Don't assume anything about the header files.  */
>  #define NO_IMPLICIT_EXTERN_C
>
> -/* If defined, a C expression whose value is a string 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.  */
>  #undef BSS_SECTION_ASM_OP
>  #define BSS_SECTION_ASM_OP "\t.section\t.bss"
>
> Index: gcc/config/i386/i386elf.h
> ===================================================================
> --- gcc/config/i386/i386elf.h   (revision 172058)
> +++ gcc/config/i386/i386elf.h   (working copy)
> @@ -100,24 +100,9 @@
>  /* Switch into a generic section.  */
>  #define TARGET_ASM_NAMED_SECTION  default_elf_asm_named_section
>
> -/* If defined, a C expression whose value is a string 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.  */
>  #undef BSS_SECTION_ASM_OP
>  #define BSS_SECTION_ASM_OP "\t.section\t.bss"
>
> -/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
> -   separate, explicit argument.  If you define this macro, it is used
> -   in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
> -   handling the required alignment of the variable.  The alignment is
> -   specified as the number of bits.
> -
> -   Try to use function `asm_output_aligned_bss' defined in file
> -   `varasm.c' when defining this macro.  */
>  #undef ASM_OUTPUT_ALIGNED_BSS
>  #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
>   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
> Index: gcc/config/sh/sh.h
> ===================================================================
> --- gcc/config/sh/sh.h  (revision 172058)
> +++ gcc/config/sh/sh.h  (working copy)
> @@ -2113,26 +2113,10 @@
>  # endif
>  #endif
>
> -
> -/* If defined, a C expression whose value is a string 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.  */
>  #ifndef BSS_SECTION_ASM_OP
>  #define BSS_SECTION_ASM_OP     "\t.section\t.bss"
>  #endif
>
> -/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
> -   separate, explicit argument.  If you define this macro, it is used
> -   in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
> -   handling the required alignment of the variable.  The alignment is
> -   specified as the number of bits.
> -
> -   Try to use function `asm_output_aligned_bss' defined in file
> -   `varasm.c' when defining this macro.  */
>  #ifndef ASM_OUTPUT_ALIGNED_BSS
>  #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
>   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
> Index: gcc/config/fr30/fr30.h
> ===================================================================
> --- gcc/config/fr30/fr30.h      (revision 172058)
> +++ gcc/config/fr30/fr30.h      (working copy)
> @@ -702,13 +702,6 @@
>    `".data"' is right.  */
>  #define DATA_SECTION_ASM_OP "\t.data"
>
> -/* If defined, a C expression whose value is a string 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 BSS_SECTION_ASM_OP "\t.section .bss"
>
>  /*}}}*/
> Index: gcc/config/m68k/m68kelf.h
> ===================================================================
> --- gcc/config/m68k/m68kelf.h   (revision 172058)
> +++ gcc/config/m68k/m68kelf.h   (working copy)
> @@ -139,25 +139,10 @@
>  #undef STARTFILE_SPEC
>  #define STARTFILE_SPEC "crtbegin.o%s"
>
> -/* If defined, a C expression whose value is a string 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.  */
>  #ifndef BSS_SECTION_ASM_OP
>  #define BSS_SECTION_ASM_OP     "\t.section\t.bss"
>  #endif
>
> -/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
> -   separate, explicit argument.  If you define this macro, it is used
> -   in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
> -   handling the required alignment of the variable.  The alignment is
> -   specified as the number of bits.
> -
> -   Try to use function `asm_output_aligned_bss' defined in file
> -   `varasm.c' when defining this macro.  */
>  #ifndef ASM_OUTPUT_ALIGNED_BSS
>  #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
>   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
> Index: gcc/config/m68k/netbsd-elf.h
> ===================================================================
> --- gcc/config/m68k/netbsd-elf.h        (revision 172058)
> +++ gcc/config/m68k/netbsd-elf.h        (working copy)
> @@ -171,15 +171,6 @@
>  #define BSS_SECTION_ASM_OP     ".section\t.bss"
>
>
> -/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
> -   separate, explicit argument.  If you define this macro, it is used
> -   in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
> -   handling the required alignment of the variable.  The alignment is
> -   specified as the number of bits.
> -
> -   Try to use function `asm_output_aligned_bss' defined in file
> -   `varasm.c' when defining this macro.  */
> -
>  #undef ASM_OUTPUT_ALIGNED_BSS
>  #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)          \
>   asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
>
>
> Anatoly.
>
>

Reply via email to