gcc -fprofile-arcs -ftest-coverage hello.c -o hello 编译后会得到一个可执行文件hello和hello.gcno文件,当用gcc编译文件的时候,如果带有“-ftest-coverage”参数,就会生成这个.gcno文件,它包含了程序块和行号等信息 接下来可以运行这个hello的程序 ./hello 5 ./hello 12 运行结束以后会生成一个hello.gcda文...
如果使用-fprofile-use选项时反馈配置文件不匹配,则警告 。 如果在使用-fprofile-gen编译和使用-fprofile-use编译时源文件发生更改,则具有配置文件反馈的文件可能无法与源文件匹配,并且GCC无法使用配置文件反馈信息。 默认情况下,此警告已启用并被视为错误。 -Wno-coverage-mismatch可用于禁用警告或-Wno-error = cove...
-ansi -fall-virtual -fcond-mismatch -fdollars-in-identifiers -fenum-int-equiv -fexternal-templates -fno-asm -fno-builtin -fhosted -fno-hosted -ffreestanding -fno-freestanding -fno-strict-prototype -fsigned-bitfields -fsigned-char -fthis-is-variable -funsigned-bitfields -funsigned-char -f...
(see manual for options) 生成列表文件 -o outputfile Name the final output file 命名最终输出文件名 --depend dependfile Save 'make' source file dependencies 保留 'make' 源文件依赖 --errors errorsfile Put stderr diagnostics to errorsfile 把标准错误判断放入errorsfile -I dir[,dir] Add dirs to...
-idirafter dir 把目录dir添加到第二包含路径中如果某个头文件在主包含路径(用-I添加的路径)中没有 找到,预处理器就搜索第二包含路径 -iprefix prefix 指定prefix作为后续-iwithprefix选项的前缀 -iwithprefix dir 把目录添加到第二包含路径中目录名由prefix和dir合并而成,这里prefix被先前的-iprefix选项指定 ...
如果使用-fprofile-use选项时反馈配置文件不匹配,则警告 。 如果在使用-fprofile-gen编译和使用-fprofile-use编译时源文件发生更改,则具有配置文件反馈的文件可能无法与源文件匹配,并且GCC无法使用配置文件反馈信息。 默认情况下,此警告已启用并被视为错误。 -Wno-coverage-mismatch可用于禁用警告或-Wno-error = cove...
-fbranch-probabilities在使用 -fprofile-arcs 选项编译程序并执行它来创建包含每个代码块执行次数的文件之后,程序可以利用这一选项再次编译,文件中所产生的信息将被用来优化那些经常发生的分支代码。如果没有这些信息,gcc将猜测那一分支可能经常发生并进行优化。这类优化信息将会存放在一个以源文件为名字的并以".da"...
待基准测试结束后,profile会生成在/home/mysql-8.0.24/gcc_build/mysql_profile/pgo_profile 编译优化后 cmake .. -DCMAKE_INSTALL_PREFIX=/home/mysql-8.0.24/gcc_build_pgoed -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_CXX_FLAGS=" -fprofile-use=/home/mysql-8.0.24/gcc_build...
-Wcoverage-mismatch Warn in case profiles in -fprofile-use do not match -Wcpp Warn when a #warning directive is encountered -Wctor-dtor-privacy 当所有构造函数和析构函数都是私有时给出警告 -Wdeclaration-after-statement 当声明出现在语句后时给出警告 ...
{f*} %{undef} %{Qn:-fno-ident} %{Qy:} %{-help:--help} %{-target-help:--target-help} %{-version:--version} %{-help=*:--help=%*} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*} %{coverage:-fprofile-arcs -ftest-coverage} %...