GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcov

Gcov now reads the correct arc flag in JSON output.

Gcov now correctly identifies true arcs in JSON output.

Gcov’s JSON output was reporting incorrect values for arc flags, specifically reporting ‘true’ when it should have checked the true_value. This commit corrects the logic to ensure accurate reporting of arc flags in JSON output, improving the reliability of coverage data.

In Details

This commit rectifies an inconsistency in gcov.cc within the json_set_prime_path_coverage function. Previously, the code checked false_value instead of true_value when determining the truthiness of an arc, leading to inaccurate JSON outputs. The fix ensures that the correct flag is evaluated, providing a more reliable representation of code coverage. This change is isolated to the gcov tool and does not directly impact other compiler components.

For Context

Gcov is a code coverage analysis tool that is integrated with GCC. It helps developers understand which parts of their code are executed during testing. Gcov can output coverage data in JSON format, which can be used by other tools for further analysis and reporting. This commit fixes a bug in gcov that was causing the JSON output to contain incorrect information about which branches of code were taken, leading to a misrepresentation of the actual code coverage data.

Filed Under: gcovcoveragejson