https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118889

--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 17 Feb 2025, gjl at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118889
> 
> --- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
> (In reply to Richard Biener from comment #1)
> > I think variables with 'static' linkage cannot be 'common'?
> 
> Shouldn't they go into .lcomm, i.e. lcomm_section?

Never heard of that ;)  In my understanding 'common' and 'local'
exclude themselves, locals should go to .bss (possibly .lcomm is
a thing on targets w/o .bss?).

> What I am trying to achieve is to implement a variable attribute, and to get
> some noswitch section attached to a VAR_DECL in static storage.
> 
> Since common static variables are not in lcomm_section, the attribute fails 
> for
> local variables.
> 
> FYI, regarding the variable attribute, what also doesn't work is to return a
> custom noswitch section in TARGET_ASM_SELECT_SECTION since that hook is not
> called for all static storage VAR_DECLs.  More on the background can be found
> at https://gcc.gnu.org/pipermail/gcc-help/2025-February/143983.html

I suppose trying to fix either is sound.

Reply via email to