https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104677
Bug ID: 104677 Summary: With -fprofile-arcs, the name of the .gcda file is incorrect Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: vincent-gcc at vinc17 dot net CC: marxin at gcc dot gnu.org Target Milestone: --- Under Debian/unstable, if I do "gcc foo.c -o foo2 -fprofile-arcs", the name of the .gcda file is "foo2-foo.gcda" instead of "foo.gcda". The behavior is correct until GCC 10.3.0, but it is incorrect with GCC 11.2.0 and gcc-12 (Debian 12-20220222-1) 12.0.1 20220222 (experimental) [master r12-7325-g2f59f067610]. The current gcc/doc/invoke.texi documentation for -fprofile-arcs contains: Each object file's @var{auxname} is generated from the name of the output file, if explicitly specified and it is not the final executable, otherwise it is the basename of the source file. but this has not changed since GCC 9 at least. Here, foo2 is the final executable (but why the word "final"?), so that one should be in the "otherwise" case.