https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93119
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:87ca615aa6f400c64d0bf13088c0ffdd14e22830 commit r10-6130-g87ca615aa6f400c64d0bf13088c0ffdd14e22830 Author: Andrew Pinski <apin...@marvell.com> Date: Fri Jan 17 06:54:53 2020 +0000 Fix target/93119 (aarch64): ICE with traditional TLS support on ILP32 The problem here was g:23b88fda665d2f995c was not a complete fix for supporting tranditional TLS on ILP32. So the problem here is a couple of things, first __tls_get_addr call will return a C pointer value so we need to use ptr_mode when we are creating the call. Then we need to convert back that register to the correct mode, either zero extending it or just creating a move instruction. Also symbol_ref can either be in SImode or DImode. So we need to allow both modes. Built and tested on aarch64-linux-gnu with no regressions. Also built a full toolchain (including glibc) defaulting to traditional TLS that targets ilp32 and lp64. ChangeLog: PR target/93119 * config/aarch64/aarch64.md (tlsgd_small_<mode>): Have operand 0 as PTR mode. Have operand 1 as being modeless, it can be P mode. (*tlsgd_small_<mode>): Likewise. * config/aarch64/aarch64.c (aarch64_load_symref_appropriately) <case SYMBOL_SMALL_TLSGD>: Call gen_tlsgd_small_* with a ptr_mode register. Convert that register back to dest using convert_mode.