https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61548
--- Comment #7 from wangzheyu <tony.wang at arm dot com> ---
I have a simpler test case to reproduce this bug, it should be an old bug for
the tree-emutls pass. The way this pass mapping the control vars and tls vars
hasn't consider that there may more than one alias for a tls var. For target
supports tls, the code can compile successfully, but the target doesn't support
tls will fail.
struct __res_state {
char x[123];
};
__thread struct __res_state foo;
extern __thread struct __res_state bar
__attribute__ ((alias ("foo")));
extern __thread struct __res_state baz
__attribute__ ((alias ("foo")));
int main()
{
bar.x[0] = 0;
baz.x[1] = 1;
return 0;
}