Bug 48309 - gcc -flto -fuse-linker-plugin generates crashing executables on MinGW
Summary: gcc -flto -fuse-linker-plugin generates crashing executables on MinGW
Status: RESOLVED DUPLICATE of bug 47891
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2011-03-28 04:59 UTC by Gordon Magnusson
Modified: 2011-03-28 17:03 UTC (History)
0 users

See Also:
Host: i686-pc-mingw32
Target: i686-pc-mingw32
Build: i686-pc-mingw32
Known to work:
Known to fail:
Last reconfirmed: 2011-03-28 09:45:36


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Magnusson 2011-03-28 04:59:01 UTC
C:\bugreport>ld -v
GNU ld (GNU Binutils) 2.21.51.20110326

C:\bugreport>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.6.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../src/configure --prefix=/c/temp/gcc/dest --enable-languages=c,c++ --with-arch=i686 --with-tune=generic --disable-libstdcxx-pch --disable-nls --disable-shared --disable-sjlj-exceptions --disable-win32-registry --enable-checking=release --enable-lto
Thread model: win32
gcc version 4.6.0 (GCC)

C:\bugreport>type foo.cpp
#include <iostream>
#include <ostream>
using namespace std;

int main() {
    cout << "Hello, C++ world!" << endl;
}

C:\bugreport>g++ foo.cpp -o foo1.exe

C:\bugreport>foo1
Hello, C++ world!

C:\bugreport>g++ -flto -fno-use-linker-plugin foo.cpp -o foo2.exe

C:\bugreport>foo2
Hello, C++ world!

C:\bugreport>g++ -flto -fuse-linker-plugin foo.cpp -o foo3.exe

C:\bugreport>foo3
Hello, C++ world!

C:\bugreport>type bar.c
#include <stdio.h>

int main(void) {
    puts("Hello, C world!");
    return 0;
}

C:\bugreport>gcc bar.c -o bar1.exe

C:\bugreport>bar1
Hello, C world!

C:\bugreport>gcc -flto -fno-use-linker-plugin bar.c -o bar2.exe

C:\bugreport>bar2
Hello, C world!

C:\bugreport>gcc -flto -fuse-linker-plugin bar.c -o bar3.exe

C:\bugreport>bar3
[Window Title]
Microsoft Windows

[Main Instruction]
bar3.exe has stopped working

[Content]
Windows can check online for a solution to the problem.

[^] Hide problem details  [Check online for a solution and close the program] [Close the program]
Problem signature:
  Problem Event Name:	APPCRASH
  Application Name:	bar3.exe
  Application Version:	0.0.0.0
  Application Timestamp:	4d90117c
  Fault Module Name:	StackHash_fd00
  Fault Module Version:	0.0.0.0
  Fault Module Timestamp:	00000000
  Exception Code:	c0000005
  Exception Offset:	00000000
  OS Version:	6.0.6002.2.2.0.256.1
  Locale ID:	1033
  Additional Information 1:	fd00
  Additional Information 2:	ea6f5fe8924aaa756324d57f87834160
  Additional Information 3:	fd00
  Additional Information 4:	ea6f5fe8924aaa756324d57f87834160

Read our privacy statement:
  http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409
Comment 1 Dmitry Gorbachev 2011-03-28 08:12:57 UTC
It can be a duplicate of bug 47891.
Comment 2 Richard Biener 2011-03-28 09:45:36 UTC
Please also specify the exact linker version you are using.
Comment 3 Dmitry Gorbachev 2011-03-28 11:35:37 UTC
(In reply to comment #2)

Gordon Magnusson wrote:
> C:\bugreport>ld -v
> GNU ld (GNU Binutils) 2.21.51.20110326
Comment 4 Andrew Pinski 2011-03-28 17:03:25 UTC

*** This bug has been marked as a duplicate of bug 47891 ***