Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-20 Thread Xinliang David Li
ok thanks. David On Fri, Mar 20, 2015 at 1:40 PM, Teresa Johnson wrote: > After offline discussions with David, I changed to the approach of > generating __tls_init for the aux module, but then modifying the LIPO > code to allow it to be statically promoted and treated as an aux > function as a

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-20 Thread Teresa Johnson
After offline discussions with David, I changed to the approach of generating __tls_init for the aux module, but then modifying the LIPO code to allow it to be statically promoted and treated as an aux function as a special case of an artificial decl. That works well. New patch below. Fixed the tes

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-20 Thread Teresa Johnson
On Thu, Mar 19, 2015 at 10:38 PM, Xinliang David Li wrote: > On Thu, Mar 19, 2015 at 9:57 PM, Teresa Johnson wrote: >> On Thu, Mar 19, 2015 at 8:00 PM, Xinliang David Li >> wrote: >>> ok -- then there is an over assertion in get_local_tls_init_fn. The >>> method can be called for aux module --

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-19 Thread Xinliang David Li
On Thu, Mar 19, 2015 at 9:57 PM, Teresa Johnson wrote: > On Thu, Mar 19, 2015 at 8:00 PM, Xinliang David Li wrote: >> ok -- then there is an over assertion in get_local_tls_init_fn. The >> method can be called for aux module -- the decl created will also be >> promoted. > > No, it won't ever be c

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-19 Thread Teresa Johnson
On Thu, Mar 19, 2015 at 8:00 PM, Xinliang David Li wrote: > ok -- then there is an over assertion in get_local_tls_init_fn. The > method can be called for aux module -- the decl created will also be > promoted. No, it won't ever be called for an aux module. Both callsites are guarded (handle_tls_

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-19 Thread Xinliang David Li
ok -- then there is an over assertion in get_local_tls_init_fn. The method can be called for aux module -- the decl created will also be promoted. Also can we rely on late promotion (special case of artificial function __tls_init? This can avoid duplicated logic here. David On Thu, Mar 19, 2015

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-19 Thread Teresa Johnson
On Thu, Mar 19, 2015 at 4:45 PM, Xinliang David Li wrote: > does generate_tls_wrapper also need to be suppressed for aux module? No, we generate the wrapper in the aux module and use it to access the TLS variable and invoke it's init function (which is defined in the variable's own module). Presu

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-19 Thread Xinliang David Li
does generate_tls_wrapper also need to be suppressed for aux module? David On Thu, Mar 19, 2015 at 4:11 PM, Teresa Johnson wrote: > New patch below. Passes regression tests plus internal application build. > > 2015-03-19 Teresa Johnson > > gcc/ > Google ref b/19618364. >

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-19 Thread Teresa Johnson
New patch below. Passes regression tests plus internal application build. 2015-03-19 Teresa Johnson gcc/ Google ref b/19618364. * cp/decl2.c (get_local_tls_init_fn): Assert on aux module. (get_tls_init_fn): Promote non-public init functions if necessary

Re: [GOOGLE] Fixes for TLS wrapper and init functions in LIPO mode

2015-03-19 Thread Teresa Johnson
On Wed, Mar 18, 2015 at 9:25 PM, Xinliang David Li wrote: > get_local_tls_init_fn can be called from other contexts other than > 'handle_tls_init' -- is the added new assertion safe ? In fact there is still an issue here, for file static TLS vars. Will work on a fix and send the original test cas