This is the mail archive of the gcc-patches@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: [C] !PUBLIC COMMON var in c-decl.c


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


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