[Bug target/77966] Corrupt function with -fsanitize-coverage=trace-pc

vda.linux at googlemail dot com gcc-bugzilla@gcc.gnu.org
Fri Oct 14 14:48:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77966

--- Comment #4 from Denis Vlasenko <vda.linux at googlemail dot com> ---
This confuses object code sanity analysis tools which check that every function
ends "properly", i.e. with a return or jump (possibly padded with nops).

Can gcc get an option like -finsert-stop-insn-when-unreachable[=insn], making
bad programs crash if they do reach "impossible" code, rather than happily
running off and executing random stuff?

For x86, one-byte INT3, INT1, HLT or two-byte UD2 insn would be a good choice.


More information about the Gcc-bugs mailing list