public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization @ 2014-11-05 8:53 trippels at gcc dot gnu.org 2014-11-05 8:54 ` [Bug ipa/63745] " trippels at gcc dot gnu.org ` (5 more replies) 0 siblings, 6 replies; 7+ messages in thread From: trippels at gcc dot gnu.org @ 2014-11-05 8:53 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63745 Bug ID: 63745 Summary: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization Product: gcc Version: 4.9.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org CC: hubicka at gcc dot gnu.org With the attached unreduced testcase I get: markus@x4 /tmp % g++ -flto -O2 foo.ii 2>&1 | grep "VideoBuffers::StartDisplayingFrame" markus@x4 /tmp % g++ -fno-devirtualize-speculatively -O2 foo.ii 2>&1 | grep "VideoBuffers::StartDisplayingFrame" markus@x4 /tmp % g++ -O2 foo.ii 2>&1 | grep "VideoBuffers::StartDisplayingFrame" /tmp/ccEenHoO.o:main.cpp:function VideoOutput::StartDisplayingFrame(): error: undefined reference to 'VideoBuffers::StartDisplayingFrame()' /tmp/ccEenHoO.o:main.cpp:function VideoPerformanceTest::Test(): error: undefined reference to 'VideoBuffers::StartDisplayingFrame()' Creduce came up with the following (invalid) testcase: % cat main.ii struct VideoBuffers { void StartDisplayingFrame (); }; struct B { VideoBuffers vbuffers; virtual void StartDisplay () { vbuffers.StartDisplayingFrame (); } }; struct VideoPerformanceTest { B *Test_vo; void Test () { while (1) Test_vo->StartDisplay (); } }; % g++ -fno-devirtualize-speculatively -O2 -Wl,--no-undefined main.ii % g++ -flto -O2 -Wl,--no-undefined main.ii % g++ -O2 -Wl,--no-undefined main.ii /tmp/ccTlyhda.o:main.ii:function B::StartDisplay(): error: undefined reference to 'VideoBuffers::StartDisplayingFrame()' /tmp/ccTlyhda.o:main.ii:function main: error: undefined reference to 'VideoBuffers::StartDisplayingFrame()' ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/63745] [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization 2014-11-05 8:53 [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization trippels at gcc dot gnu.org @ 2014-11-05 8:54 ` trippels at gcc dot gnu.org 2014-11-05 9:03 ` trippels at gcc dot gnu.org ` (4 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: trippels at gcc dot gnu.org @ 2014-11-05 8:54 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63745 --- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- Created attachment 33888 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33888&action=edit unreduced testcase ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/63745] [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization 2014-11-05 8:53 [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization trippels at gcc dot gnu.org 2014-11-05 8:54 ` [Bug ipa/63745] " trippels at gcc dot gnu.org @ 2014-11-05 9:03 ` trippels at gcc dot gnu.org 2014-11-05 9:48 ` trippels at gcc dot gnu.org ` (3 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: trippels at gcc dot gnu.org @ 2014-11-05 9:03 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63745 --- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- Sorry reduced testcase was cut off. Here it is in its full glory: struct VideoBuffers { void StartDisplayingFrame (); }; struct B { VideoBuffers vbuffers; virtual void StartDisplay () { vbuffers.StartDisplayingFrame (); } }; struct VideoPerformanceTest { B *Test_vo; void Test () { while (1) Test_vo->StartDisplay (); } }; VideoPerformanceTest a; int main () { a.Test (); } ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/63745] [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization 2014-11-05 8:53 [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization trippels at gcc dot gnu.org 2014-11-05 8:54 ` [Bug ipa/63745] " trippels at gcc dot gnu.org 2014-11-05 9:03 ` trippels at gcc dot gnu.org @ 2014-11-05 9:48 ` trippels at gcc dot gnu.org 2014-11-05 12:30 ` rguenth at gcc dot gnu.org ` (2 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: trippels at gcc dot gnu.org @ 2014-11-05 9:48 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63745 --- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- And here's a hopefully valid testcase: markus@x4 tmp % cat main.ii struct VideoBuffers { void StartDisplayingFrame (); }; struct B { VideoBuffers vbuffers; virtual void StartDisplay () { vbuffers.StartDisplayingFrame (); } }; struct VideoPerformanceTest { B *Test_vo; void Test () { if (!Test_vo) return; while (1) Test_vo->StartDisplay (); } }; VideoPerformanceTest a; int main () { a.Test (); } ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/63745] [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization 2014-11-05 8:53 [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization trippels at gcc dot gnu.org ` (2 preceding siblings ...) 2014-11-05 9:48 ` trippels at gcc dot gnu.org @ 2014-11-05 12:30 ` rguenth at gcc dot gnu.org 2014-11-05 13:38 ` hubicka at ucw dot cz 2014-11-05 14:14 ` trippels at gcc dot gnu.org 5 siblings, 0 replies; 7+ messages in thread From: rguenth at gcc dot gnu.org @ 2014-11-05 12:30 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63745 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Target Milestone|--- |4.9.3 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/63745] [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization 2014-11-05 8:53 [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization trippels at gcc dot gnu.org ` (3 preceding siblings ...) 2014-11-05 12:30 ` rguenth at gcc dot gnu.org @ 2014-11-05 13:38 ` hubicka at ucw dot cz 2014-11-05 14:14 ` trippels at gcc dot gnu.org 5 siblings, 0 replies; 7+ messages in thread From: hubicka at ucw dot cz @ 2014-11-05 13:38 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63745 --- Comment #4 from Jan Hubicka <hubicka at ucw dot cz> --- > struct VideoBuffers > { > void StartDisplayingFrame (); > }; > struct B > { > VideoBuffers vbuffers; > virtual void > StartDisplay () > { > vbuffers.StartDisplayingFrame (); > } So we devirtualize to StartDisplay but that leads to linker failure because StartDisplayingFrame is not linked with the object file. I think this is similar to some earlier testcases we run across in libreoffice and we managed to declare it invalid - if you provide inline function body you need to link the unit with symbols it uses. Honza ^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug ipa/63745] [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization 2014-11-05 8:53 [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization trippels at gcc dot gnu.org ` (4 preceding siblings ...) 2014-11-05 13:38 ` hubicka at ucw dot cz @ 2014-11-05 14:14 ` trippels at gcc dot gnu.org 5 siblings, 0 replies; 7+ messages in thread From: trippels at gcc dot gnu.org @ 2014-11-05 14:14 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63745 Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- (In reply to Jan Hubicka from comment #4) > > struct VideoBuffers > > { > > void StartDisplayingFrame (); > > }; > > struct B > > { > > VideoBuffers vbuffers; > > virtual void > > StartDisplay () > > { > > vbuffers.StartDisplayingFrame (); > > } > So we devirtualize to StartDisplay but that leads to linker failure because > StartDisplayingFrame is not linked with the object file. > > I think this is similar to some earlier testcases we run across in > libreoffice > and we managed to declare it invalid - if you provide inline function body > you > need to link the unit with symbols it uses. OK. That was my fist reaction, too. But it is irritating that it succeeds with -flto. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-11-05 14:14 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-11-05 8:53 [Bug ipa/63745] New: [4.9/5 Regression] mythtv build failure due to aggressive speculative devirtualization trippels at gcc dot gnu.org 2014-11-05 8:54 ` [Bug ipa/63745] " trippels at gcc dot gnu.org 2014-11-05 9:03 ` trippels at gcc dot gnu.org 2014-11-05 9:48 ` trippels at gcc dot gnu.org 2014-11-05 12:30 ` rguenth at gcc dot gnu.org 2014-11-05 13:38 ` hubicka at ucw dot cz 2014-11-05 14:14 ` trippels at gcc dot gnu.org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).