Fix another -freorder-blocks-and-partition glitch with Windows SEH
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 19 Apr 2021 08:13:36 +0000 (10:13 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 19 Apr 2021 08:19:13 +0000 (10:19 +0200)
commit0bb37e80bb786e11cb7aa2d23b7d68bb0357fc15
treeda29c545d6548ccf4e631d75c3c5c9035bce6e7c
parentd64720a07f611c55e8c815c775a852d650a2e738
Fix another -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 FDEs for a single function in
DWARF for exception purposes and doing an equivalent trick for Windows SEH.

Now the Windows system unwinder does not support arbitrarily large frames
and there is even a hard limit on the encoding of the CFI, which changes
the stack allocation strategy when it is topped and which must be reflected
everywhere.

gcc/
* config/i386/winnt.c (i386_pe_seh_cold_init): Properly deal with
frames larger than the SEH maximum frame size.
gcc/testsuite/
* gnat.dg/opt92.adb: New test.
gcc/config/i386/winnt.c
gcc/testsuite/gnat.dg/opt92.adb [new file with mode: 0644]