https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107353
--- Comment #12 from Alexander Monakov <amonakov at gcc dot gnu.org> --- ICE on the emutls-3.c testcase isn't related to emutls. Rather, the frontend invokes decl_default_tls_model before attributes are processed, so the first time around we miss the 'common' attribute when deciding the TLS access model. The following cut-down testcase fails on x86 as well with -m32 -fpie: __attribute__((common)) __thread int i; int *f() { return &i; } Before the offending commit GCC compiled 'f' as if the attribute was ignored. (on ELF targets combining TLS and COMMON is problematic if not undefined)