[c++] Avoid C++ FE creating !public weak variables

Jan Hubicka hubicka@ucw.cz
Thu Nov 12 20:54:00 GMT 2009


> On 11/12/2009 02:38 PM, Jan Hubicka wrote:
>> With some further sanity checking I noticed that with -fno-weak we also tend to
>> create DECL_COMDAT !TREE_PUBLIC functions.  This is caused by comdat_linkage function
>> that simply drops to this path when no weak support is there.
>> Is this expected behaviour or shall we also clear COMDAT flag here?
>> Some of cgraph code assumes that COMDAT decls are public, I can fix it on that side too.
>
> I'm not sure what the best answer is for vague-linkage functions that we  
> can't actually share between translation units because of target  
> limitations.  There is some code in the front end that expects  
> DECL_COMDAT to be set on these decls, though it could be changed to use  
> a different test.

This is moderately ugly from backend perspective to have random flag set that
make no real difference.  If it would help cp FE, we can also just clear this
flag in the visibility pass where we mangle the flags anyway.

Honza
>
> Jason



More information about the Gcc-patches mailing list