https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106258
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org, | |mjambor at suse dot cz --- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> --- This is Martin's area, so adding CC. The patch turns unreachables to traps. Traps are handled somewhat specially in IPA code since they are used to mark calls that are known to be dead after inlining/specialization. We special case this sanity check unreachables and I suppose we can do that for traps too. diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index f352212e463..ddfd0a93c43 100644 --- a/gcc/cgraph.cc +++ b/gcc/cgraph.cc @@ -1548,7 +1548,8 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e) else { if (flag_checking - && !fndecl_built_in_p (e->callee->decl, BUILT_IN_UNREACHABLE)) + && !fndecl_built_in_p (e->callee->decl, BUILT_IN_UNREACHABLE) + && !fndecl_built_in_p (e->callee->decl, BUILT_IN_TRAP)) ipa_verify_edge_has_no_modifications (e); new_stmt = e->call_stmt; gimple_call_set_fndecl (new_stmt, e->callee->decl);