Created attachment 25301 [details] OpenMP test program If I use "-flto" to build libgomp, and build one OpenMP program with this lib using "-flto -fuse-linker-plugin", then the program running will crash. If I use "-flto" to build OpenMP program, then will be no problem, so this may be libgomp's lto compile issue. The issue locate the problem of parallel.c. gdb log: GNU gdb (pcx32) 7.3.50.20110709 Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from e:\t\temp\a.exe...done. (gdb) run Starting program: e:\t\temp\a.exe [New Thread 6032.0x1468] Program received signal SIGSEGV, Segmentation fault. gomp_icv (write=false) at e:\new\gcc\gcc4.6\build\libgomp\libgomp.h:380 380 struct gomp_task *task = gomp_thread ()->task; (gdb) bt #0 gomp_icv (write=false) at e:\new\gcc\gcc4.6\build\libgomp\libgomp.h:380 #1 gomp_resolve_num_threads (specified=2, count=0) at e:\new\gcc\gcc4.6\build\libgomp\parallel.c:45 #2 0x00403088 in GOMP_parallel_start (fn=0x402950 <main.$loopfn.0>, data=0x28fe98, num_threads=2) at e:\new\gcc\gcc4.6\build\libgomp\parallel.c:107 #3 0x0040c18c in main () at e:\t\temp\main.c:29 (gdb) step Program received signal SIGSEGV, Segmentation fault. gomp_icv (write=false) at e:\new\gcc\gcc4.6\build\libgomp\libgomp.h:380 380 struct gomp_task *task = gomp_thread ()->task; (gdb) bt #0 gomp_icv (write=false) at e:\new\gcc\gcc4.6\build\libgomp\libgomp.h:380 #1 gomp_resolve_num_threads (specified=2, count=0) at e:\new\gcc\gcc4.6\build\libgomp\parallel.c:45 #2 0x00403088 in GOMP_parallel_start (fn=0x402950 <main.$loopfn.0>, data=0x28fe98, num_threads=2) at e:\new\gcc\gcc4.6\build\libgomp\parallel.c:107 #3 0x0040c18c in main () at e:\t\temp\main.c:29 (gdb) step [Inferior 1 (process 6032) exited with code 030000000005] Any ideas? Thanks.
Created attachment 25303 [details] The
sorry, I put a wrong test program. The newer is right.
It's my fault. I think this is not libgomp and lto issue, and that's the libpthread's problem. Close it.
It's invalid issue.