https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93319
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <h...@gcc.gnu.org>: https://gcc.gnu.org/g:8e0efc10335bf9bb447f2188254609dcfad7de8a commit r10-6122-g8e0efc10335bf9bb447f2188254609dcfad7de8a Author: H.J. Lu <hjl.to...@gmail.com> Date: Tue Jan 21 14:09:53 2020 -0800 i386: Do GNU2 TLS address computation in ptr_mode Since GNU2 TLS address from glibc run-time is in ptr_mode, we should do GNU2 TLS address computation in ptr_mode and zero-extend result to Pmode. gcc/ PR target/93319 * config/i386/i386.c (ix86_tls_module_base): Replace Pmode with ptr_mode. (legitimize_tls_address): Do GNU2 TLS address computation in ptr_mode and zero-extend result to Pmode. * config/i386/i386.md (@tls_dynamic_gnu2_64_<mode>): Replace :P with :PTR and Pmode with ptr_mode. (*tls_dynamic_gnu2_lea_64_<mode>): Likewise. (*tls_dynamic_gnu2_call_64_<mode>): Likewise. (*tls_dynamic_gnu2_combine_64_<mode>): Likewise. gcc/testsuite/ PR target/93319 * gcc.target/i386/pr93319-1a.c: Don't include <stdio.h>. (test1): Replace printf with __builtin_printf.