Fix -freorder-blocks-and-partition glitch with Windows SEH
Since GCC 8, the -freorder-blocks-and-partition pass can split a function into hot and cold parts, thus generating 2 CIEs for a single function in DWARF for exception purposes and doing an equivalent trick for Windows SEH. Now the Windows system unwinder is picky when it comes to the boundary between an active EH region and the end of the function and, therefore, a nop may need to be added in specific cases. gcc/ * config/i386/winnt.c (i386_pe_seh_unwind_emit): When switching to the cold section, emit a nop before the directive if the previous active instruction can throw.
This commit is contained in:
parent
5e40542f87
commit
85cefe2256
@ -1231,6 +1231,10 @@ i386_pe_seh_unwind_emit (FILE *asm_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. */
|
||||
rtx_insn *prev = prev_active_insn (insn);
|
||||
if (prev && !insn_nothrow_p (prev))
|
||||
fputs ("\tnop\n", asm_out_file);
|
||||
fputs ("\t.seh_endproc\n", asm_out_file);
|
||||
seh->in_cold_section = true;
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user