@@ -16438,8 +16438,10 @@ ix86_output_call_insn (rtx_insn *insn, rtx call_op)
break;
/* If we get to the epilogue note, prevent a catch region from
- being adjacent to the standard epilogue sequence. If non-
- call-exceptions, we'll have done this during epilogue emission. */
+ being adjacent to the standard epilogue sequence. Note that,
+ if non-call exceptions are enabled, we already did it during
+ epilogue expansion, or else, if the insn can throw internally,
+ we already did it during the reorg pass. */
if (NOTE_P (i) && NOTE_KIND (i) == NOTE_INSN_EPILOGUE_BEG
&& !flag_non_call_exceptions
&& !can_throw_internal (insn))
@@ -1243,9 +1243,9 @@ i386_pe_seh_unwind_emit (FILE *out_file, rtx_insn *insn)
seh = cfun->machine->seh;
if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
{
- /* See ix86_seh_fixup_eh_fallthru for the rationale. */
+ /* See ix86_output_call_insn/seh_fixup_eh_fallthru for the rationale. */
rtx_insn *prev = prev_active_insn (insn);
- if (prev && !insn_nothrow_p (prev))
+ if (prev && (CALL_P (prev) || !insn_nothrow_p (prev)))
fputs ("\tnop\n", out_file);
fputs ("\t.seh_endproc\n", out_file);
seh->in_cold_section = true;