GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/gcov

Fix function summaries with suppressed blocks

Corrects gcov's function summary output for suppressed code blocks.

This commit fixes two issues in gcov’s function summary generation. It corrects the coverage.paths field to use the correct count, preventing incorrect output like ‘0.00% of -1’. It also adds a missing else condition to prevent ‘No conditions’ from being printed inappropriately.

In Details

In gcc/gcov.cc, the add_path_counts function now correctly reads paths.size() instead of an incorrect field, resolving issues in function summary path coverage calculations. Additionally, an else block was added to function_summary to properly handle cases where conditions are not applicable, preventing misleading 'No conditions' output.

For Context
gcov
A code coverage analysis tool used with GCC. It measures how much of your code is executed by tests.
function summary
A condensed report generated by gcov that summarizes the execution statistics for an entire function.
Filed Under: gcovcoveragetesting