https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61591
--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> --- (In reply to Marek Polacek from comment #3) > Recently I rewrote the implementation of -fsanitize=unreachable and now I > get an Illegal instruction on the testcase attached. So is there anything > else to do? That is strange, because I don't (using trunk revision 218205 on x86_64-linux). I don't know what the difference could be, the compiler is configured with ../src/configure --prefix=/home/mjambor/gcc/trunk/inst --enable-languages=c,c++,fortran --enable-checking=yes --disable-bootstrap --with-plugin-ld=/home/mjambor/binutils/obj/gold/ld-new and I compile the testcase with: ~/gcc/trunk/inst/bin/g++ modif.C -O3 -fsanitize=unreachable -fsanitize-undefined-trap-on-error -fdump-tree-ccp2 -fdump-tree-optimized I can see in the two dumps that the only builtin called is __builtin_unreachable. Removing -fsanitize-undefined-trap-on-error makes no difference. The resultant a.out does not fail in any way. Only when I change function ipa_impossible_devirt_target to return BUILTIN_TRAP, it fails because of the illegal instruction.