[Testcase 1] Missing profile data file with -fprofile-use. The sort.c file contains two functions main() and stop() gcc -c sort.c -fprofile-use -O1 -fprofile-dir=/data2/user/gcc-temp/fdo/profdata/ sort.c: In function ‘main’: sort.c:29:1: error: ‘/data2/user/gcc-temp/fdo/profdata//#data2#user#gcc-temp#fdo#sort.gcda’ profile count data file not found, regenerating profiles may help [-Werror=missing-profile] 29 | } | ^ sort.c:29:1: error: profile for function ‘main’ not found in profile data, regenerating profiles may help [-Werror=missing-profile] sort.c: In function ‘stop’: sort.c:29:1: error: profile for function ‘stop’ not found in profile data, regenerating profiles may help [-Werror=missing-profile] cc1: some warnings being treated as errors make: *** [sort.o] Error 1 [Testcase 2] bubble_sort.c has a non-empty function bubble_sort() for which profile data exists. Now at profile-use phase, a user adds empty function before1() before an existing lone function bubble_sort() and empty function after1() after the lone existing function bubble_sort() gcc -c bubble_sort.c -fprofile-use -O1 -fprofile-dir=/data2/user/gcc-temp/fdo/profdata/ bubble_sort.c: In function ‘after1’: bubble_sort.c:19:1: error: profile for function ‘after1’ not found in profile data, regenerating profiles may help [-Werror=missing-profile] 19 | void after1() { } | ^~~~ bubble_sort.c: In function ‘bubble_sort’: bubble_sort.c:19:1: error: source locations for function ‘bubble_sort’ have changed, the profile data may be out of date [-Werror=coverage-mismatch] bubble_sort.c: In function ‘before1’: bubble_sort.c:19:1: error: profile for function ‘before1’ not found in profile data, regenerating profiles may help [-Werror=missing-profile] cc1: some warnings being treated as errors make: *** [bubble_sort.o] Error 1 [Testcase 3] Use -Wno-error=missing-profile to treat them as warnings, not errors gcc -c bubble_sort.c -fprofile-use -O1 -Wno-error=missing-profile -fprofile-dir=/data2/user/gcc-temp/fdo/profdata/ bubble_sort.c: In function ‘after1’: bubble_sort.c:19:1: warning: profile for function ‘after1’ not found in profile data, regenerating profiles may help [-Wmissing-profile] 19 | void after1() { } | ^~~~ bubble_sort.c: In function ‘bubble_sort’: bubble_sort.c:19:1: error: source locations for function ‘bubble_sort’ have changed, the profile data may be out of date [-Werror=coverage-mismatch] bubble_sort.c: In function ‘before1’: bubble_sort.c:19:1: warning: profile for function ‘before1’ not found in profile data, regenerating profiles may help [-Wmissing-profile] cc1: some warnings being treated as errors make: *** [bubble_sort.o] Error 1