Four tests in libgomp.fortran (omp_parse3.f90, pr25162.f, and threadprivate[23].f90 started failing with this patch: http://gcc.gnu.org/viewcvs?view=rev&rev=133801 r133801 | george | 2008-04-01 17:23:36 -0400 (Tue, 01 Apr 2008) This small testcase fails in the same way when compiled with "-m64 -g -fopenmp": program test call foo end subroutine foo real testvar common /testcom/ testvar c$omp threadprivate(/testcom/) testvar = 1.0 return end Output: elm3b145% /opt/gcc-nightly/trunk-20080406/bin/gfortran -g -m64 -fopenmp tls1.f -lgomp /opt/gcc-nightly/binutils-2.18/bin/ld: /tmp/cc0dFrjq.o(.debug_info+0x74): R_PPC64_ADDR64 used with TLS symbol testcom_ I'll attach the .s files for revisions 133800 and 133801 for the same source but without the first three lines.
Created attachment 15462 [details] generated code before patch
Created attachment 15463 [details] generated code after patch
I think we are emitting the debug info too early for _testcom before we marked it as a TLS.
Before: .quad testcom_@dtprel+0x8000 After: .8byte testcom_
Actually we just don't take into account TLSness of the decl/RTL.
Subject: Bug 35896 Author: jakub Date: Wed May 7 23:15:50 2008 New Revision: 135060 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135060 Log: PR debug/35896 * dwarf2out.c (dw_expand_expr, common_check): Removed. (fortran_common): New function. (gen_variable_die): Call fortran_common instead of common_check, adjust for it returning tree instead of rtx. Formatting. Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c
Fixed.