- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Intel 12 Compiler seems to inline virtual functions where he should'nt (when optimization and IPO enabled).
The given solution should output (tested with Intel Compiler 11 and Visual C++ 2005/2008)
Caller implementation
Plugin implementation
But if i compile the Caller (EXE) with Intel 12 (Compiler XE 12.0.2.154 [IA-32]), with /O2 and /Qipoit outputs
Caller implementation
Callerimplementation
This is very surprising from a professionnal compiler to have such a subjective interpretation of the keyword "virtual"...
Regards,
Emmanuel
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems a bug in Intel compiler. I am investigating the issue. I will update when done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I reproduced the issue using VS2010 IDE.
I could not reproduce the issue when using command lines give below:
I could not reproduce the issue when using command lines give below:
c:\>icl /c /Qvc10 /Zi /W3 /O2 /Oi /Qipo /Qftz- -D WIN32 -D NDEBUG -D _WINDOWS -D _USRDLL -D INTEL12BUGPLUGIN_EXPORTS -D _WINDLL -D _UNICODE -DUNICODE /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP Plugin.cpp
c:\>icl /Qoption,link,/OUT:Intel12BugPlugin.dll /Qoption,link,/DLL "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" Plugin.obj
c:\>icl /c /Qvc10 /Zi /W3 /Od /Oi /Qipo /Qftz- -D WIN32 -D NDEBUG -D _CONSOLE -D _UNICODE -D UNICODE /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP Caller.cpp
c:>icl Intel12BugPlugin.lib Caller.obj
Is there something missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand, did you manage to reproduce the bug within the IDE or do you need me to send you a solution with Visual 2010 ?
I'm not use to command line, although running the lines you gave me the compiler outputs:
ipo: remark #11001: performing single-file optimizations
And I don't know how to force multi-file optimization (because I already tested like I said in the initial post that the bug happen only in multi-file optimization (/Qipo) and not single fine optimization (/Qip).
Obviously in single-file optimization, the compiler has no hint to issue make static call from virtual call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After some trial, I have reproduced the bug with the following command lines:
[bash]icl /c /Qvc10 /Zi /W3 /O2 /Oi /Qipo /Qftz- -D WIN32 -D NDEBUG -D _WINDOWS -D _USRDLL -D _WINDLL -D _UNICODE -DUNICODE /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP Plugin/Plugin.cpp icl /Qoption,link,/OUT:Plugin.dll /Qoption,link,/DLL "kernel32.lib" "user32.lib" Plugin.obj icl /Qvc10 /Zi /W3 /O2 /Oi /Qipo /Qftz- -D WIN32 -D NDEBUG -D _CONSOLE -D _UNICODE -D UNICODE /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP Caller/Caller.cpp Plugin.lib [/bash]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have submitted a bug report to Intel compiler development team on this. I will update the thread when I have more info on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use compiler option -Qopt-class-analysis- then the problem is resolved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Knowlege base article based on this thread is available at http://software.intel.com/en-us/articles/wrong-optimization-in-class-analysis-when-calling-virtual-function/.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thanks for your fix, it will be very usefull.
It this still considered as a bug to be solved by the Compiler Team ?
Best regards and thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The fix is implemeted by compiler team but it is not targeted for Intel compiler 12.0.
In case you can not manage with work-around, please let us know.
In case you can not manage with work-around, please let us know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The issue is fixed in latest Intel C++ Composer XE 12.1. The composer is available for download from Intel download center.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page