Re: [PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-11 Thread Alexander Monakov
On Mon, 8 Sep 2025, H.J. Lu wrote: > Don't check tls_model attribute when optimizing TLS access since > > 1. -ftls-model=initial-exec also can specify tls_model without tls_model > attribute. There's a difference: -ftls-model is usable only for upgrading the model; if you pass -ftls-model=glob

Re: [PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-09 Thread H.J. Lu
On Tue, Sep 9, 2025 at 11:55 AM Alexander Monakov wrote: > > > On Tue, 9 Sep 2025, H.J. Lu wrote: > > > > But this doesn't imply that recomputed model would be weaker. > > > > > > As I understand, the actual issue is that decl_default_tls_model does not > > > iterate the attribute list, and so can

Re: [PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-09 Thread Alexander Monakov
On Tue, 9 Sep 2025, H.J. Lu wrote: > > But this doesn't imply that recomputed model would be weaker. > > > > As I understand, the actual issue is that decl_default_tls_model does not > > iterate the attribute list, and so can return a weaker model than what the > > front-end assigned based on th

Re: [PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-09 Thread H.J. Lu
On Tue, Sep 9, 2025 at 10:36 AM Alexander Monakov wrote: > > > > On Tue, 9 Sep 2025, H.J. Lu wrote: > > > On Tue, Sep 9, 2025 at 9:04 AM Alexander Monakov wrote: > > > > > > > > > On Tue, 9 Sep 2025, H.J. Lu wrote: > > > > > > > > > to restore assert if not compiling for shared library. When >

Re: [PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-09 Thread Alexander Monakov
On Tue, 9 Sep 2025, H.J. Lu wrote: > On Tue, Sep 9, 2025 at 9:04 AM Alexander Monakov wrote: > > > > > > On Tue, 9 Sep 2025, H.J. Lu wrote: > > > > > > > to restore assert if not compiling for shared library. When compiling > > > > > for shared library, the recomputed model may be weaker. > >

Re: [PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-09 Thread H.J. Lu
On Tue, Sep 9, 2025 at 9:04 AM Alexander Monakov wrote: > > > On Tue, 9 Sep 2025, H.J. Lu wrote: > > > > > to restore assert if not compiling for shared library. When compiling > > > > for shared library, the recomputed model may be weaker. > > > > > > I don't understand why (for shared libraries

Re: [PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-09 Thread Alexander Monakov
On Tue, 9 Sep 2025, H.J. Lu wrote: > > > to restore assert if not compiling for shared library. When compiling > > > for shared library, the recomputed model may be weaker. > > > > I don't understand why (for shared libraries), can you explain? > > Another shared library or executable may over

[PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-08 Thread H.J. Lu
Don't check tls_model attribute when optimizing TLS access since 1. -ftls-model=initial-exec also can specify tls_model without tls_model attribute. 2. Linker can optimize TLS access at link-time. 3. LTO should perform the similar optimization. Since C, C++, and Fortran front-ends now set the TLS