This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFH] Uses of output.h in the front ends


On Tue, Jun 5, 2012 at 7:57 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> ... which has been deprecated for GCC 4.7 (see
>> http://gcc.gnu.org/gcc-4.7/changes.html). Support for Tru64 has
>> already been removed on trunk. Tru64 was ECOFF, right? That means that
>> Tru64 also has BSS
>> (http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V50A_ACRO_SUP/OBJSPE
>>C.PDF). Did GCC support that for Tru64 too?
>
> Sure, it has BSS since the point of the change was to put variables there. ?The
> problem was how to tell the assembler to put it there.

Part of the problem why it isn't put there by gcc 4.7 because the
initializer is not a bss_initializer_p initializer. And this is
because GNAT explicitly disables this in misc.c:

/* Initialize options structure OPTS.  */

static void
gnat_init_options_struct (struct gcc_options *opts)
{
  /* Uninitialized really means uninitialized in Ada.  */
  opts->x_flag_zero_initialized_in_bss = 0;
}

However, if the above code is removed (i.e.
flag_zero_initialized_in_bss == 1, the default),
categorize_decl_for_section returns SECCAT_BSS for BigArray, but the
variable is still not put in .bss. This is because there is no special
TARGET_ASM_SELECT_SECTION for Tru64, so default_select_section is
called and it returns data_section.

But at that point, bss_section==NULL anyway, because
BSS_SECTION_ASM_OP is not defined for Tru64, even though ECOFF does
support BSS sections.

So I think that to fix this "properly" (and assumibng , support for
.bss should be added to Tru64 by defining BSS_SECTION_ASM_OP, and
implementing TARGET_ASM_SELECT_SECTION.

The same happens for rs6000-ibm-aix6.1, which also doesn't have
BSS_SECTION_ASM_OP, even though there should be BSS support for XCOFF
(http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.files%2Fdoc%2Faixfiles%2FXCOFF.htm).

AFAIU the equivalent C test case is a file with just "char
BigArray[1024*1024*256 -1] = {0};", where BigArray ends up in .data
instead of .bss. If the "= {0}" is removed, BigArray is put in
.common.

Ciao!
Steven


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]