[Bug gcov-profile/121074] [16 Regression] ICE: in gcov_open, at gcov-io.cc:128 with -ftest-coverage -fauto-profile

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 25 16:10:21 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121074

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:476d61a8cb28b627f99500a30ccd11e36ade0a72

commit r16-8288-g476d61a8cb28b627f99500a30ccd11e36ade0a72
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Mar 25 14:40:59 2026 +0100

    gcov-profile/121074 - hold onto gcov file for less time

    The following fixes the issue of two open gcov files at the
    same time, one from -ftest-coverage, opened/closed by
    coverage_init/finish and one from -fauto-profile, attempted
    to be opened by pass_ipa_auto_profile.  The solution is
    to open the coverage files only during pass_ipa_tree_profile.

            PR gcov-profile/121074
            * coverage.h (coverage_init_file): Declare.
            (coverage_finish_file): Likewise.
            * coverage.cc (coverage_init_file): New function, split
            out actual file opening and writing from ...
            (coverage_init): ... here.
            (coverage_finish_file): Likewise for file closing, from ...
            (coverage_finish): ... here.
            * tree-profile.cc (tree_profiling): Call coverage_init_file
            and coverage_finish_file here.


More information about the Gcc-bugs mailing list