https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124583
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I can reproduce it:
[apinski@xeond2 upstream-gcc-git]$ mv attachment.cgi\?id\=63982 a-t.gcda
[apinski@xeond2 upstream-gcc-git]$ ~/upstream-gcc/bin/gcc t.c
[apinski@xeond2 upstream-gcc-git]$ ./a.out
2
[apinski@xeond2 upstream-gcc-git]$ ~/upstream-gcc/bin/gcc t.c -O2
-fprofile-use -Wno-coverage-mismatch
t.c: In function ‘main’:
t.c:38:5: warning: profile for function ‘main’ not found in profile data
[-Wmissing-profile]
38 | int main() {
| ^~~~
t.c: In function ‘kk’:
t.c:31:5: warning: profile for function ‘kk’ not found in profile data
[-Wmissing-profile]
31 | int kk(int p1) {
| ^~
t.c: In function ‘iy’:
t.c:26:5: warning: profile for function ‘iy’ not found in profile data
[-Wmissing-profile]
26 | int iy(int p1) {
| ^~
t.c: In function ‘in’:
t.c:17:5: warning: profile for function ‘in’ not found in profile data
[-Wmissing-profile]
17 | int in(int *p1) {
| ^~
t.c: In function ‘e’:
t.c:6:6: warning: profile for function ‘e’ not found in profile data
[-Wmissing-profile]
6 | void e(int p1) {
| ^
[apinski@xeond2 upstream-gcc-git]$ ./a.out
0