This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C] !PUBLIC COMMON var in c-decl.c
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Thu, 12 Nov 2009 17:29:04 +0000 (UTC)
- Subject: Re: [C] !PUBLIC COMMON var in c-decl.c
- References: <20091112171312.GE14355@kam.mff.cuni.cz>
On Thu, 12 Nov 2009, Jan Hubicka wrote:
> Hi,
> my extra sanity check got this positive at build_compound_literal where we
> build COMDAT function that is not PUBLIC. I think this is bug. This is
> excersised by c99-complit-1.c
> Should not the code call make_decl_one_only?
>
> Honza
>
> * c-decl.c (build_compound_literal): Make COMDAT public.
The question you should ask is why it is COMDAT. It certainly shouldn't
be public; the names for compound literals are an internal implementation
default and it's OK for different translation units to have different
compound literals assigned the same internal name. *If it has
const-qualified type* then the storage used may be shared with other
compound literals with the same contents (whatever the internal names).
--
Joseph S. Myers
joseph@codesourcery.com