Try to compile libgomp/testsuite/libgomp.c/copyin-1.c at -O0: eric@linux:~/build/gcc/native> gcc/xgcc -Bgcc -c copyin-1.c -I ~/build/gcc/native/x86_64-suse-linux/libgomp -fopenmp /tmp/ccB3EieP.s: Assembler messages: /tmp/ccB3EieP.s:278: Error: Accessing `thr' as thread-local object /tmp/ccB3EieP.s:278: Error: Accessing `thr' as thread-local object /tmp/ccB3EieP.s:278: Error: Accessing `thr' as thread-local object /tmp/ccB3EieP.s:278: Error: Accessing `thr' as thread-local object /tmp/ccB3EieP.s:278: Error: Accessing `thr' as thread-local object /tmp/ccB3EieP.s:278: Error: Accessing `thr' as thread-local object eric@linux:~/build/gcc/native> gcc/xgcc -Bgcc -c copyin-1.c -I ~/build/gcc/native/x86_64-suse-linux/libgomp -fopenmp -funit-at-a-time eric@linux:~/build/gcc/native> gcc/xgcc -Bgcc -c copyin-1.c -I ~/build/gcc/native/x86_64-suse-linux/libgomp -fopenmp -O -fno-unit-at-a-time /tmp/ccTYpCzg.s: Assembler messages: /tmp/ccTYpCzg.s:220: Error: Accessing `thr' as thread-local object /tmp/ccTYpCzg.s:220: Error: Accessing `thr' as thread-local object /tmp/ccTYpCzg.s:220: Error: Accessing `thr' as thread-local object /tmp/ccTYpCzg.s:220: Error: Accessing `thr' as thread-local object /tmp/ccTYpCzg.s:220: Error: Accessing `thr' as thread-local object /tmp/ccTYpCzg.s:220: Error: Accessing `thr' as thread-local object
Confirmed. Even shorter testcase: ================================== int i=0; #pragma omp threadprivate (i) void foo() { i=0; } ==================================
Subject: Bug 26171 Author: jakub Date: Wed Apr 26 08:26:06 2006 New Revision: 113271 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113271 Log: PR c/26171 * cgraph.c (cgraph_varpool_finalize_decl): Don't call cgraph_varpool_assemble_pending_decls if -fopenmp, unless cgraph_global_info_ready. * testsuite/libgomp.c/pr26171.c: New test. Added: trunk/libgomp/testsuite/libgomp.c/pr26171.c Modified: trunk/gcc/ChangeLog trunk/gcc/cgraph.c trunk/libgomp/ChangeLog
Fixed in SVN.