https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63839
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Author: mpolacek Date: Fri Nov 14 11:22:12 2014 New Revision: 217553 URL: https://gcc.gnu.org/viewcvs?rev=217553&root=gcc&view=rev Log: PR sanitizer/63839 * asan.c (ATTR_CONST_NORETURN_NOTHROW_LEAF_LIST, ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST): Define. * builtin-attrs.def (ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST): Define. * builtins.c (fold_builtin_0): Don't include ubsan.h. Don't instrument BUILT_IN_UNREACHABLE here. * sanitizer.def (BUILT_IN_UBSAN_HANDLE_BUILTIN_UNREACHABLE): Make const. * sanopt.c (pass_sanopt::execute): Instrument BUILT_IN_UNREACHABLE. * tree-ssa-ccp.c (optimize_unreachable): Bail out if SANITIZE_UNREACHABLE. * ubsan.c (ubsan_instrument_unreachable): Rewrite for GIMPLE. * ubsan.h (ubsan_instrument_unreachable): Adjust declaration. testsuite/ * c-c++-common/ubsan/pr63839.c: New test. * c-c++-common/ubsan/unreachable-2.c: New test. Added: trunk/gcc/testsuite/c-c++-common/ubsan/pr63839.c trunk/gcc/testsuite/c-c++-common/ubsan/unreachable-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/asan.c trunk/gcc/builtin-attrs.def trunk/gcc/builtins.c trunk/gcc/sanitizer.def trunk/gcc/sanopt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-ccp.c trunk/gcc/ubsan.c trunk/gcc/ubsan.h