Do not call null register_common in emutls

Jeff Law law@redhat.com
Thu Feb 13 20:06:00 GMT 2020


On Thu, 2020-02-06 at 04:07 -0300, Alexandre Oliva wrote:
> Thread-local variables with DECL_COMMON trigger an internal compiler
> error on targets that use emulated TLS without register_common, when
> we attempt to expand a call to the NULL register_common, with
> testcases as simple as gcc.dg/tls/emutls-2.c.
> 
> The documentation states that, on such targets, common variables would
> fall back to explicitly initialized.  This patch rearranges the code
> that deals with initialization of common and non-common variables,
> complementing code that is already in place to detect
> register_common-less targets.
> 
> 
> Regstrapped on x86_64-linux-gnu, tested on an affected target.
> Ok to install?
> 
> 
> for  gcc/ChangeLog
> 
> 	* tree-emutls.c (new_emutls_decl, emutls_common_1): Complete
> 	handling of register_common-less targets.
> 
> for  gcc/testsuite/ChangeLog
> 
> 	* gcc.dg/tls/emutls-3.c: New, combining emutls-2.c and
> 	thr-init-2.c into an execution test with explicitly common
> 	variables.
Not strictly a regression AFAICT, but it seems OK for the trunk to me.

jeff
> 



More information about the Gcc-patches mailing list