https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113765
--- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> --- Seems to be a regression, I tested the same setup on gcc 13 and the test passes there: 55:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation, -fprofile-generate -D_PROFILE_GENERATE 59:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution, -fprofile-generate -D_PROFILE_GENERATE 62:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation, -fprofile-use -D_PROFILE_USE 66:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution, -fprofile-use -D_PROFILE_USE 76:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation, -g -DFOR_AUTOFDO_TESTING 108:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution, -g -DFOR_AUTOFDO_TESTING 111:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c compilation, -fauto-profile -DFOR_AUTOFDO_TESTING -fearly-inlining 115:PASS: gcc.dg/tree-prof/val-profiler-threads-1.c execution, -fauto-profile -DFOR_AUTOFDO_TESTING -fearly-inlining