This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [RFC][PATCH] Change default to -fcommon
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Biener <richard dot guenther at gmail dot com>, Sandra Loosemore <sandra at codesourcery dot com>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Tue, 21 Nov 2017 11:40:38 +0100
- Subject: Re: [RFC][PATCH] Change default to -fcommon
- Authentication-results: sourceware.org; auth=none
- References: <DB6PR0801MB20537CD32063175699A3E50F832F0@DB6PR0801MB2053.eurprd08.prod.outlook.com> <CAFiYyc1nHMX73evvnCcF1x0SeP7=p72VOinfw3oyaak-d2TanA@mail.gmail.com> <DB6PR0801MB2053E05E8489867CFC86DF2E83220@DB6PR0801MB2053.eurprd08.prod.outlook.com>
> There is one use in Ada which looks like an optimization for specific
> targets:
>
> /* Ada doesn't feature Fortran-like COMMON variables so we shouldn't
> try to fiddle with DECL_COMMON. However, on platforms that don't
> support global BSS sections, uninitialized global variables would
> go in DATA instead, thus increasing the size of the executable. */
> if (!flag_no_common
> && TREE_CODE (var_decl) == VAR_DECL
> && TREE_PUBLIC (var_decl)
> && !have_global_bss_p ())
> DECL_COMMON (var_decl) = 1;
It's for Darwin - you need to evaluate your patch on Darwin.
> I don't understand how this works - if there is no bss support in the
> linker, wouldn't common variables would still end up in the data section?
There is, it's essentially a syntactic issue in the assembler IIRC.
--
Eric Botcazou