On 4/16/20 6:50 AM, Iain Sandoe wrote:
Hi Nathan,

Iain Sandoe <idsan...@googlemail.com> wrote:

Nathan Sidwell <nat...@acm.org> wrote:

My fix for 94147 was confusing no-linkage with internal linkage, at the 
language level.  That's wrong. (the std is confusing here, because it describes 
linkage of names (which is wrong), and lambdas have no names)

Lambdas with extra-scope, have linkage.  However, at the implementation-level 
that linkage is at least as restricted as the linkage of the extra-scope decl.

Further, when instantiating a variable initialized by a lambda, we must 
determine the visibility of the variable itself, before instantiating its 
initializer.  If the template arguments are internal (or no-linkage), the 
variable will have internal linkage, regardless of the linkage of the template 
it is instantiated from.  We need to know that before instantiating the lambda, 
so we can restrict its linkage correctly.

I'll commit this in a few days.

As discussed on irc,

The testcase for this fails on Darwin, where we don’t use .local or .comm for 
the var.

I’ve tested this on x86-64-linux and darwin,
but I plan on testing on a few more Darwin boxen,
OK to apply, if additional testing passes?

that testing revealed some differences in storage description for the variable 
(powerpc 32b darwin puts it in bss, like linux, but the remainer of the 
platform versions use .static_data).  However, that’s not the relevant 
observation.

the observation is that the storage and symbols for

_Z3VARIZ1qvEUlvE_E

has not changed between gcc-9 and trunk.

What has changed is the function that initializes that variable:

_Z4InitIN3VARIZ1qvEUlvE_EUlvE_EEbT_

which was weak / comdat [Linux]  weak / global [Darwin] and now is text section 
local (which is what I understood was the intention of the change) .. so I 
wonder if the scan-asms are testing what you intended?

That is indeed the expected change.

how about the following - where IMO, from the observation above, the first two 
tests are not especially useful and could be removed.

the remainder of the amendments cater for USER_LABEL_PREFIX and a different 
spelling for ‘weak’ in the Darwin assembly language.

So - this now tests that the symbol exists, is spelled the way you intend and 
is not weak (or global on Darwin).


WDYT?

Thanks for checking, please apply.

(My secret plan worked! someone generalized the regexps!)


--
Nathan Sidwell

Reply via email to