Bug 50429 - LibGOMP built with "-flto" will result in crash code for OpenMP program...
Summary: LibGOMP built with "-flto" will result in crash code for OpenMP program...
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.6.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 10:19 UTC by xunxun
Modified: 2011-09-16 10:37 UTC (History)
0 users

See Also:
Host: *-*-mingw32
Target: *-*-mingw32
Build: *-*-mingw32
Known to work:
Known to fail: 4.6.1
Last reconfirmed:


Attachments
OpenMP test program (455 bytes, text/x-csrc)
2011-09-16 10:19 UTC, xunxun
Details
The (487 bytes, text/x-csrc)
2011-09-16 10:29 UTC, xunxun
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xunxun 2011-09-16 10:19:40 UTC
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.
Comment 1 xunxun 2011-09-16 10:29:50 UTC
Created attachment 25303 [details]
The
Comment 2 xunxun 2011-09-16 10:31:14 UTC
sorry, I put a wrong test program.

The newer is right.
Comment 3 xunxun 2011-09-16 10:36:21 UTC
It's my fault.
I think this is not libgomp and lto issue, and that's the libpthread's problem.
Close it.
Comment 4 xunxun 2011-09-16 10:37:55 UTC
It's invalid issue.