Do not call null register_common in emutls
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.
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.