3
我想使用配置文件优化一个相当复杂的C++项目(多个源文件,链接到Boost库,GSL和OpenCV)。使用cmake,我先用使用g ++和CMake损坏的配置文件信息
set(CMAKE_CXX_FLAGS " -O3 -ffast-math -fprofile-generate=profiling -pg -fopenmp ")
编译运行具有典型的输入生成的可执行文件后,我编译
set(CMAKE_CXX_FLAGS " -O3 -ffast-math -fprofile-use=profiling -fopenmp ")
编译失败,出现大量的错误是这样的:
/n/user/projects/project_name/src/foo.cpp: In member function ‘double TLinearInterp::operator()(double) const’:
/n/user/projects/project_name/src/foo.cpp:86:1: error: corrupted profile info: profile data is not flow-consistent
}
^
/n/user/projects/project_name/src/foo.cpp:86:1: error: corrupted profile info: number of executions for edge 2-7 thought to be -7232
/n/user/projects/project_name/src/foo.cpp:86:1: error: corrupted profile info: number of executions for edge 2-3 thought to be 20996551
/n/user/projects/project_name/src/foo.cpp:86:1: error: corrupted profile info: number of executions for edge 3-7 thought to be -28135
/n/user/projects/project_name/src/foo.cpp:86:1: error: corrupted profile info: number of executions for edge 3-4 thought to be 21024686
我使用GNU编译器的4.8.0版本。从编译器标志中可以看到,我的项目使用OpenMP。
什么可能导致配置文件信息的损坏?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38292 – kfsone
如果这一漏洞影响到每一个项目,我尝试分析和-02/3编译?我发现我可以在启用-03的情况下成功分析一个非常简单的C++项目(解决Project Euler问题16)。 – Thucydides411
通常情况下,成功配置文件的含义是他们设法让配置文件生成一些输出,并且由于他们没有发现任何改进,他们宣布成功。我相信你可以做得比这更好。 [*点击这里。*](http://stackoverflow.com/a/927773/23771)顺便说一句,我不打开-O3,直到*之后*手动挤压它。 –