i386: Do not use %ecx DRAP for functions that use __builtin_eh_return [PR104362]
commit599122fa690d55e5e14d74f4d514b2d8b6a98505
authorUros Bizjak <ubizjak@gmail.com>
Thu, 3 Feb 2022 21:24:21 +0000 (3 22:24 +0100)
committerUros Bizjak <ubizjak@gmail.com>
Thu, 3 Feb 2022 21:25:21 +0000 (3 22:25 +0100)
treebd23a9ee07d4d97be6e321a47aef1c71d5141c32
parent30d15b512e375dee1b288d66c398513b8cb3e2aa
i386: Do not use %ecx DRAP for functions that use __builtin_eh_return [PR104362]

%ecx can't be used for both DRAP register and eh_return.  Adjust find_drap_reg
to choose %edi for functions that uses __builtin_eh_return to avoid the assert
in ix86_expand_epilogue that enforces this rule.

2022-02-03  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

PR target/104362
* config/i386/i386.cc (find_drap_reg): For 32bit targets
return DI_REG if function uses __builtin_eh_return.

gcc/testsuite/ChangeLog:

PR target/104362
* gcc.target/i386/pr104362.c: New test.
gcc/config/i386/i386.cc
gcc/testsuite/gcc.target/i386/pr104362.c [new file with mode: 0644]