https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89423
Bug ID: 89423 Summary: -fvtable-verify does not work properly with -flto Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: ctice at gcc dot gnu.org Target Milestone: --- When compiled with '-flto' the extra internal functions that VTV generates,and which are necessary for it to work correctly, do not get propagated into the final binary. You can see this compiling the bb_tests.cc test case in the libvtv testsuite, and grepping for 'GLOBAL' in the final output: $ /usr/local/google3/cmtice/gcc-fsf.root/usr/local/bin/g++ -o bb_tests bb_tests.cc -O1 -fvtable-verify=std // Compile without flto $ nm bb_tests | grep GLOBAL 0000000000601000 d _GLOBAL_OFFSET_TABLE_ 0000000000400930 t _GLOBAL__sub_I.00099__Z14get_cond_value $ /usr/local/google3/cmtice/gcc-fsf.root/usr/local/bin/g++ -o bb_tests_flto bb_tests.cc -O1 -flto -fvtable-verify=std // Compile with flto $ nm bb_tests_flto | grep GLOBAL 0000000000601000 d _GLOBAL_OFFSET_TABLE_