Commit d0ee17a5 by Dominik Vogt Committed by Andreas Krebbel

PR target/79890: S/390: Fix crash.

builtin_eh_return requires the return address to be saved on the
stack.  The patch prevents using an FPR for that.

gcc/ChangeLog:

2017-04-05  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/79890
	* config/s390/s390.c (s390_register_info_gprtofpr): Return if
	call_eh_return is true.

gcc/testsuite/ChangeLog:

2017-04-05  Dominik Vogt  <vogt@linux.vnet.ibm.com>

	PR target/79890
	* gcc.target/s390/pr79890.c: New test case.

From-SVN: r246701
parent b88a6a88
2017-04-05 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/79890
* config/s390/s390.c (s390_register_info_gprtofpr): Return if
call_eh_return is true.
2017-04-05 Andreas Krebbel <krebbel@linux.vnet.ibm.com> 2017-04-05 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390-c.c (s390_resolve_overloaded_builtin): * config/s390/s390-c.c (s390_resolve_overloaded_builtin):
......
...@@ -9512,6 +9512,12 @@ s390_register_info_gprtofpr () ...@@ -9512,6 +9512,12 @@ s390_register_info_gprtofpr ()
if (!TARGET_Z10 || !TARGET_HARD_FLOAT || !crtl->is_leaf) if (!TARGET_Z10 || !TARGET_HARD_FLOAT || !crtl->is_leaf)
return; return;
/* builtin_eh_return needs to be able to modify the return address
on the stack. It could also adjust the FPR save slot instead but
is it worth the trouble?! */
if (crtl->calls_eh_return)
return;
for (i = 15; i >= 6; i--) for (i = 15; i >= 6; i--)
{ {
if (cfun_gpr_save_slot (i) == SAVE_SLOT_NONE) if (cfun_gpr_save_slot (i) == SAVE_SLOT_NONE)
......
2017-04-05 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/79890
* gcc.target/s390/pr79890.c: New test case.
2017-04-05 Jakub Jelinek <jakub@redhat.com> 2017-04-05 Jakub Jelinek <jakub@redhat.com>
PR target/80310 PR target/80310
......
/* { dg-do compile } */
/* { dg-options "-Wno-pedantic" } */
void bar (void);
void
foo (int x)
{
__builtin_unwind_init ();
__builtin_eh_return (x, bar);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment