[Bug target/39578] Linkage broken for dllimport vtables
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39578 --- Comment #4 from John E. / TDM tdragon at tdragon dot net --- I can confirm this has been fixed. Sorry for not doing so sooner.
[Bug c++/43601] Enormous increase in DLL object files size in 4.5
--- Comment #14 from tdragon at tdragon dot net 2010-04-23 00:05 --- This affects a *ton* of code in the wild. Can we at least get a command line flag like -fno-emit-inline-dllexports? -- tdragon at tdragon dot net changed: What|Removed |Added CC||tdragon at tdragon dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601
[Bug target/39530] [4.3/4.4/4.5 regression] runtime_error text not shown
--- Comment #10 from tdragon at tdragon dot net 2009-04-02 23:57 --- This is the exact same behavior as is present in the most recent MinGW stable release of GCC (3.4.5-20060117-3), and will be present in any release which uses Danny's throwing-exceptions-from-DLLs-even-with-a-static-libgcc patch or my port of it, including TDM-GCC releases *as well as* the nuwen.net release the initial reporter is using. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39530
[Bug target/39578] New: Linkage broken for dllimport vtables
The linkage for the vtable for any class marked dllimport is generated as a standard external link rather than a dllimport __imp_ link. This results in linker diagnostics such as: Info: resolving vtable for TestObject by linking to __imp___ZTV10TestObject (auto-import) d:/jsupport/mingw/bin/../lib/gcc/mingw32/4.3.3-dw2/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs. The following simple testcase demonstrates this. - vttest.cpp - struct __attribute__((dllimport)) TestObject { virtual void VirtFunc(); }; int main() { TestObject obj; obj.VirtFunc(); return 0; } - vttestdll.cpp - struct __attribute__((dllexport)) TestObject { virtual void VirtFunc() {} }; g++ -shared -o vttest.dll -Wl,--out-implib,libvttest.dll.a vttestdll.cpp Creating library file: libvttest.a g++ -o vttest.exe vttest.cpp libvttest.dll.a Info: resolving vtable for TestObject by linking to __imp___ZTV10TestObject (auto-import) d:/jsupport/mingw/bin/../lib/gcc/mingw32/4.3.3-dw2/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from auto-imported DLLs. -- Summary: Linkage broken for dllimport vtables Product: gcc Version: 4.3.3 Status: UNCONFIRMED Severity: critical Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tdragon at tdragon dot net GCC build triplet: mingw32 GCC host triplet: mingw32 GCC target triplet: mingw32 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39578
[Bug target/36654] [4.2 Regression] Inlined con/de-structor breaks virtual inheritance dllimport classes
--- Comment #14 from tdragon at tdragon dot net 2009-03-29 15:30 --- I have just filed PR39578, the cause of which may be related to this PR or its fix. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug c++/36654] [4.2/4.3 Regression] Inlined con/de-structor breaks virtual inheritance dllimport classes
--- Comment #9 from tdragon at tdragon dot net 2009-01-02 14:23 --- That patch seems to work fine, and I haven't seen any unwarranted errors relating to static data members so far. Thank you very much for tracking this down! -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug c++/36654] [4.3 regression] Inlined con/de-structor breaks virtual inheritance dllimport classes
--- Comment #7 from tdragon at tdragon dot net 2008-11-02 00:54 --- C'mon, folks! Any chance of getting this fixed? -- tdragon at tdragon dot net changed: What|Removed |Added Summary|Inlined con/de-structor |[4.3 regression] Inlined |breaks virtual inheritance |con/de-structor breaks |dllimport classes |virtual inheritance ||dllimport classes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug c++/36654] Inlined con/de-structor breaks virtual inheritance dllimport classes
--- Comment #6 from tdragon at tdragon dot net 2008-10-09 22:57 --- Ping! Any ideas on this bug? -- tdragon at tdragon dot net changed: What|Removed |Added Known to fail|4.2.4 4.3.0 4.3.1 |4.2.4 4.3.0 4.3.1 4.3.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug c++/36654] Inlined con/de-structor breaks virtual inheritance dllimport classes
--- Comment #5 from tdragon at tdragon dot net 2008-09-20 17:57 --- Any news or thoughts on this bug? (*Ping*) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug c++/36654] Inlined con/de-structor breaks virtual inheritance dllimport classes
--- Comment #3 from tdragon at tdragon dot net 2008-08-12 02:13 --- As of r138967 pulled down today from the 4.3 branch, this bug is in fact still present. Shell session follows. g++ -v Using built-in specs. Target: mingw32 Configured with: ../gcc-4.3-svn/configure --prefix=/mingw --build=mingw32 --enable-languages=c,c++ --with-bugurl=http://www.tdragon.net/recentgcc/bugs.php --disable-nls --disable-win32-registry --disable-werror --enable-threads --disable-symvers --enable-cxx-flags='-fno-function-sections -fno-data-sections' --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable-sjlj-exceptions --with-pkgversion='GCC TDM-1 for MinGW' --disable-bootstrap Thread model: win32 gcc version 4.3.2 20080811 (prerelease) (GCC TDM-1 for MinGW) g++ -c deltatest.ii deltatest.ii:8: internal compiler error: in maybe_emit_vtables, at cp/decl2.c:1745 Please submit a full bug report, with preprocessed source if appropriate. See http://www.tdragon.net/recentgcc/bugs.php for instructions. -- tdragon at tdragon dot net changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|DUPLICATE | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug c++/36654] New: Inlined con/de-structor breaks in dllimport classes with virtual inheritance
In mingw32 builds of the GCC 4.3 branch, the following code causes an ICE: class blah {}; class __attribute__((dllimport)) vchild : virtual public blah { vchild() {} }; The dllimport attribute, the virtual inheritance, and the inline constructor are key to causing the error. A Windows prompt session using the MinGW GCC 4.3.0 alpha follows: g++ -v Using built-in specs. Target: mingw32 Configured with: ../gcc-4.3.0/configure --enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --disable-sjlj-exceptions --enable-shared --enable-libgcj --enable-libgomp --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-concept-checks --enable-version-specific-runtime-libs --build=mingw32 --with-bugurl=http://www.mingw.org/bugs.shtml --prefix=/mingw --with-gmp=/mingw/src/gcc/gmp-mpfr-root --with-mpfr=/mingw/src/gcc/gmp-mpfr-root --with-libiconv-prefix=/mingw/src/gcc/libiconv-root Thread model: win32 gcc version 4.3.0 20080305 (alpha-testing) mingw-20080502 (GCC) g++ -c deltatest.ii deltatest.ii:8: internal compiler error: in maybe_emit_vtables, at cp/decl2.c:1678 Please submit a full bug report, with preprocessed source if appropriate. See http://www.mingw.org/bugs.shtml for instructions. -- Summary: Inlined con/de-structor breaks in dllimport classes with virtual inheritance Product: gcc Version: 4.3.1 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tdragon at tdragon dot net GCC build triplet: mingw32 GCC host triplet: mingw32 GCC target triplet: mingw32 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug c++/36654] Inlined con/de-structor breaks virtual inheritance dllimport classes
--- Comment #1 from tdragon at tdragon dot net 2008-06-27 17:09 --- I have also discovered that this bug is *not* present in the MinGW 4.2.1 TP (or in MinGW 3.4.5), but is present in unofficial builds of GCC 4.3.1 and 4.2.4 as well as 4.3.0. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36654
[Bug target/35921] Con/de-structor definition fails to override dllimport declaration
--- Comment #7 from tdragon at tdragon dot net 2008-05-29 17:31 --- Created an attachment (id=15702) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15702action=view) Minimal testcase for vtable issue I'm not sure whether this is related, but the effect is similar so I'm adding it to this same bug. Basically, we get an undefined reference to the vtable for a dllimport-ed struct with a single inner-defined virtual function. Again, it's something that worked in mingw32 in previous GCC releases and fails in 4.3.0. Command line compilation and output: g++ -c impoverride2.cpp nm impoverride2.o b .bss d .data r .rdata$_ZTI3foo r .rdata$_ZTS3foo r .rdata$_ZTV3foo t .text t .text$_ZN3foo3barEv t .text$_ZN3fooC1Ev T __Z3depv T __ZN3foo3barEv T __ZN3fooC1Ev R __ZTI3foo R __ZTS3foo R __ZTV3foo U __ZTVN10__cxxabiv117__class_type_infoE U __imp___ZTV3foo Shouldn't be there! g++ -v Using built-in specs. Target: mingw32 Configured with: ../gcc-4.3.0/configure --prefix=/mingw --build=mingw32 --enable-languages=c,ada,c++,fortran,objc,obj-c++ --with-bugurl=http://www.tdragon.net/recentgcc/bugs.php --disable-nls --disable-win32-registry --enable-libgomp --disable-werror --enable-threads --disable-symvers --enable-cxx-flags='-fno-function-sections -fno-data-sections' --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --program-suffix=-dw2 --with-pkgversion='GCC TDM-3/DW2 for MinGW' Thread model: win32 gcc version 4.3.0-dw2 (GCC TDM-3/DW2 for MinGW) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35921
[Bug target/35921] Con/de-structor definition fails to override dllimport declaration
--- Comment #9 from tdragon at tdragon dot net 2008-05-29 22:13 --- (In reply to comment #8) Uhh, if you declare a struct as dllimport, then you are declaring that it's vtable is defined in a dll. So why is this a bug? Well, it's a change from mingw32/3.4.5's behavior. At any rate, after thinking about it I agree that it isn't a bug. Thanks, John E. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35921
[Bug target/35921] Con/de-structor definition fails to override dllimport declaration
--- Comment #5 from tdragon at tdragon dot net 2008-04-16 00:50 --- The issue is fixed for me when applying the mentioned patch to 4.3.0, so as far as I'm concerned we can close this bug as soon as someone applies the fix to 4.3 SVN. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35921
[Bug target/35921] New: Con/de-structor definition fails to override dllimport declaration
When the attached file is compiled with a mingw32 build of GCC 4.3.0, the constructor definition for foo does not fully override the declaration in the struct which inherits the dllimport attribute, and a dllimport reference is incorrectly emitted. The member function bar() is provided as an example of correctly overriding the dllimport declaration; this issue only occurs with constructors and destructors. Compilation command line and output: g++ -c impoverride.cpp impoverride.cpp:8: warning: 'foo::foo()' redeclared without dllimport attribute: previous dllimport ignored impoverride.cpp:12: warning: 'void foo::bar()' redeclared without dllimport attr ibute: previous dllimport ignored nm impoverride.o b .bss d .data t .text 0011 T __Z3depv 000c T __ZN3foo3barEv 0006 T __ZN3fooC1Ev T __ZN3fooC2Ev U __imp___ZN3fooC1Ev Shouldn't be there! g++ -v Using built-in specs. Target: mingw32 Configured with: ../../gcc-4.3.0-ehstatic/configure --prefix=/mingw --build=ming w32 --enable-languages=c,c++ --disable-nls --disable-win32-registry --enable-sjl j-exceptions --enable-libgomp --with-gmp=/d/cygdev/gccbuild/libsfor43/debug/gmp- install --with-mpfr=/d/cygdev/gccbuild/libsfor43/debug/mpfr-install --with-libic onv-prefix=/d/cygdev/gccbuild/libsfor43/debug/iconv-install --disable-werror --e nable-threads --enable-libstdcxx-debug --enable-cxx-flags='-fno-function-section s -fno-data-sections' --disable-symvers Thread model: win32 gcc version 4.3.0 (GCC) -- Summary: Con/de-structor definition fails to override dllimport declaration Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tdragon at tdragon dot net GCC build triplet: mingw32 GCC host triplet: mingw32 GCC target triplet: mingw32 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35921
[Bug target/35921] Con/de-structor definition fails to override dllimport declaration
--- Comment #1 from tdragon at tdragon dot net 2008-04-12 22:45 --- Created an attachment (id=15469) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15469action=view) Minimal testcase -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35921
[Bug tree-optimization/32328] [4.2 Regression] -fstrict-aliasing causes skipped code
--- Comment #30 from tdragon at tdragon dot net 2008-02-22 18:14 --- Are there sufficient motivation and resources to fix this bug in 4.2? Since 4.3 is soon-to-be, an update on this would be sincerely appreciated -- even if it's just forgetting about 4.2 and resolving as FIXED. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug tree-optimization/32328] 4.2.0: -O2 causes skipped code
--- Comment #6 from tdragon at tdragon dot net 2007-06-20 14:44 --- Created an attachment (id=13743) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13743action=view) Better testcase; compile with -O2, use with alias_main.c Compiling this file with -O2 and linking with the object file from alias_main.c creates a program that demonstrates the miscompilation. Curiously, compiling with -O2 and -fno-strict-aliasing produces a correct compilation. -- tdragon at tdragon dot net changed: What|Removed |Added Attachment #13701|0 |1 is obsolete|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug tree-optimization/32328] 4.2.0: -O2 causes skipped code
--- Comment #7 from tdragon at tdragon dot net 2007-06-20 14:46 --- Created an attachment (id=13744) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13744action=view) Better testcase pt.2; use with alias1.c Compile this file with any or no additional options as desired; linking with the object file from alias1.c to create a program that demonstrates the miscompilation, if alias1.c was compiled with -O2. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug tree-optimization/32328] 4.2.0: -O2 causes skipped code
--- Comment #8 from tdragon at tdragon dot net 2007-06-20 14:52 --- Not seeing any further action or confirmation on this yet, I've gone ahead and created a simpler testcase. It's plain that, when using -O2, line 14 of alias1.c is skipped. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug tree-optimization/32328] [4.2/4.3 Regression] -fstrict-aliasing causes skipped code
--- Comment #11 from tdragon at tdragon dot net 2007-06-20 15:35 --- Not sure if this is relevant or just GCC working differently on my target system, but I don't encounter the bug using -fstrict-aliasing, or in fact using individually the entire set of options under -O and -O2 on http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Optimize-Options.html -- only when I specifically use the option -O2. i.e. gcc -fstrict-aliasing -c alias1.c DOESN'T, for me, cause the bug but gcc -O2 -c alias1.c DOES. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug c/32328] New: 4.2.0: -O2 causes skipped code
When the attached file is compiled with a mingw32 build of GCC 4.2.0 using the -O2 option (gcc -O2 -c timestamp2.i), lines 159 and 160 are never executed when running the program that uses this file. Since the hashitem function modifies the variable b which is passed to it by-address, leaving those statements out is definitely not a valid optimization. Compiling without -O2 (gcc -c timestamp2.i) gives the correct result. Sorry I can't read assembler, or I'd try to narrow things down more. This is a regression from 4.1.2, which works correctly with or without -O2. If it helps, the GCC binaries I use (and sources) can be downloaded at http://hosted.filefront.com/tldragon7. -- Summary: 4.2.0: -O2 causes skipped code Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tdragon at tdragon dot net GCC build triplet: i386-pc-mingw32 GCC host triplet: i386-pc-mingw32 GCC target triplet: i386-pc-mingw32 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug c/32328] 4.2.0: -O2 causes skipped code
--- Comment #1 from tdragon at tdragon dot net 2007-06-13 21:19 --- Created an attachment (id=13701) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13701action=view) Preprocessed example source -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug tree-optimization/32328] 4.2.0: -O2 causes skipped code
--- Comment #3 from tdragon at tdragon dot net 2007-06-13 22:27 --- (In reply to comment #2) Do you mean the last two stores to b: b-time = time; b-progress = found ? 4 : 2; Yes, those two lines are the ones that are wrongly skipped. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug tree-optimization/32328] 4.2.0: -O2 causes skipped code
--- Comment #4 from tdragon at tdragon dot net 2007-06-13 22:36 --- (In reply to comment #2) Though we could have an alias violation if you don't cast back in hashitem to the correct type of the argument. hashitem() uses the type as punned to HASHDATA* (where HASHDATA is a struct with a single member of type char*). However, by implementation hashitem() will never assign a new address that doesn't point to the same type as what was passed -- in this case, it will only ever assign another BINDING*. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328
[Bug tree-optimization/32328] 4.2.0: -O2 causes skipped code
--- Comment #5 from tdragon at tdragon dot net 2007-06-13 22:47 --- Is it possible that an optimization enabled by -O2 *assumes* that hashitem() will conform with strict aliasing by not dereferencing that argument, and thus optimizes those lines away? (Not the case.) If this is what is happening and is the correct behavior, then this is in fact user error and I'm sorry to have wasted your time. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32328