gcc 警告 "coverage_mismatch" 是什么意思?
What does the gcc warning "coverage_mismatch" mean?
今天我在编译一些 erlang/opt:
时遇到 Werror=Wcoverage_mismatch
错误
beam/beam_emu.c: In function 'erts_current_reductions':
beam/beam_emu.c:3150:1: error: the control flow of function 'erts_current_reductions' does not match its profile data (counter 'arcs') [-Werror=coverage-mismatch]
}
...
但我不知道它是什么意思,google 也没有告诉我关于这个标志的任何信息。
下面是gcc source code
if (entry->n_counts != n_counts)
warning_printed = warning_at(
DECL_SOURCE_LOCATION(current_function_decl), OPT_Wcoverage_mismatch,
"number of counters in profile data for function %qD "
"does not match "
"its profile data (counter %qs, expected %i and have %i)",
current_function_decl, ctr_names[counter], entry->n_counts, n_counts);
else
warning_printed = warning_at(
DECL_SOURCE_LOCATION(current_function_decl), OPT_Wcoverage_mismatch,
"the control flow of function %qD does not match "
"its profile data (counter %qs)",
current_function_decl, ctr_names[counter]);
参见 Warning options 上的 GCC (9.2.0) 手册:
-Wno-coverage-mismatch
Warn if feedback profiles do not match when using the -fprofile-use
option. If a source file is changed between compiling with -fprofile-generate
and with -fprofile-use
, the files with the profile feedback can fail to match the source file and GCC cannot use the profile feedback information. By default, this warning is enabled and is treated as an error. -Wno-coverage-mismatch
can be used to disable the warning or -Wno-error=coverage-mismatch
can be used to disable the error. Disabling the error for this warning can result in poorly optimized code and is useful only in the case of very minor changes such as bug fixes to an existing code-base. Completely disabling the warning is not recommended.
因此,看起来您的源代码自编译以来已经发生了变化,这很可能会导致问题(因此出现错误消息)。重新编译并重新运行分析。
今天我在编译一些 erlang/opt:
时遇到Werror=Wcoverage_mismatch
错误
beam/beam_emu.c: In function 'erts_current_reductions':
beam/beam_emu.c:3150:1: error: the control flow of function 'erts_current_reductions' does not match its profile data (counter 'arcs') [-Werror=coverage-mismatch]
}
...
但我不知道它是什么意思,google 也没有告诉我关于这个标志的任何信息。 下面是gcc source code
if (entry->n_counts != n_counts)
warning_printed = warning_at(
DECL_SOURCE_LOCATION(current_function_decl), OPT_Wcoverage_mismatch,
"number of counters in profile data for function %qD "
"does not match "
"its profile data (counter %qs, expected %i and have %i)",
current_function_decl, ctr_names[counter], entry->n_counts, n_counts);
else
warning_printed = warning_at(
DECL_SOURCE_LOCATION(current_function_decl), OPT_Wcoverage_mismatch,
"the control flow of function %qD does not match "
"its profile data (counter %qs)",
current_function_decl, ctr_names[counter]);
参见 Warning options 上的 GCC (9.2.0) 手册:
-Wno-coverage-mismatch
Warn if feedback profiles do not match when using the
-fprofile-use
option. If a source file is changed between compiling with-fprofile-generate
and with-fprofile-use
, the files with the profile feedback can fail to match the source file and GCC cannot use the profile feedback information. By default, this warning is enabled and is treated as an error.-Wno-coverage-mismatch
can be used to disable the warning or-Wno-error=coverage-mismatch
can be used to disable the error. Disabling the error for this warning can result in poorly optimized code and is useful only in the case of very minor changes such as bug fixes to an existing code-base. Completely disabling the warning is not recommended.
因此,看起来您的源代码自编译以来已经发生了变化,这很可能会导致问题(因此出现错误消息)。重新编译并重新运行分析。