https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78229
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P1 Status|UNCONFIRMED |NEW Last reconfirmed| |2016-11-07 Component|rtl-optimization |target Target Milestone|--- |6.3 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. Happens after forwprop. t.i: In function ‘void fn3()’: t.i:8:10: error: BB 6 can not throw but has an EH edge void fn3() { ^~~ looks like __builtin_ia32_tzcnt_u32 is not marked NOTHROW but we now fold that in the backend. CCing Jakub - this is a recent regression. Foldings may not transfer EH info themselves. Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 241891) +++ gcc/config/i386/i386.c (working copy) @@ -37664,7 +37664,7 @@ ix86_gimple_fold_builtin (gimple_stmt_it gsi_insert_before (gsi, g, GSI_SAME_STMT); g = gimple_build_assign (gimple_call_lhs (stmt), NOP_EXPR, lhs); gimple_set_location (g, loc); - gsi_replace (gsi, g, true); + gsi_replace (gsi, g, false); return true; } break; fixes this. Otherwise untested.