public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR target/79890: S/390: Fix crash.
@ 2017-04-04 22:08 Dominik Vogt
  2017-04-05  8:29 ` Andreas Krebbel
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Vogt @ 2017-04-04 22:08 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andreas Krebbel

[-- Attachment #1: Type: text/plain, Size: 152 bytes --]

The attached patch fixes PR 79890.  Bootstrapped and regression
tested on s390x biarch and s390.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany

[-- Attachment #2: 0001-ChangeLog --]
[-- Type: text/plain, Size: 223 bytes --]

gcc/ChangeLog-pr79890

	PR target/79890
	* config/s390/s390.c (s390_register_info_gprtofpr): Return if
	call_eh_return is true.
gcc/testsuite/ChangeLog-pr79890

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

[-- Attachment #3: 0001-PR-target-79890-S-390-Fix-crash.patch --]
[-- Type: text/plain, Size: 1406 bytes --]

From 99062b1d7476132c996966f15c11c3090e0dcd2a Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@linux.vnet.ibm.com>
Date: Tue, 4 Apr 2017 12:31:43 +0100
Subject: [PATCH] PR target/79890: S/390: Fix crash.

---
 gcc/config/s390/s390.c                  |  6 ++++++
 gcc/testsuite/gcc.target/s390/pr79890.c | 11 +++++++++++
 2 files changed, 17 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/s390/pr79890.c

diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 51b3d46..2cb8947 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -9512,6 +9512,12 @@ s390_register_info_gprtofpr ()
   if (!TARGET_Z10 || !TARGET_HARD_FLOAT || !crtl->is_leaf)
     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--)
     {
       if (cfun_gpr_save_slot (i) == SAVE_SLOT_NONE)
diff --git a/gcc/testsuite/gcc.target/s390/pr79890.c b/gcc/testsuite/gcc.target/s390/pr79890.c
new file mode 100644
index 0000000..e9894df
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr79890.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Wno-pedantic" } */
+
+void bar (void);
+
+void
+foo (int x)
+{
+  __builtin_unwind_init ();
+  __builtin_eh_return (x, bar);
+}
-- 
2.3.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PR target/79890: S/390: Fix crash.
  2017-04-04 22:08 [PATCH] PR target/79890: S/390: Fix crash Dominik Vogt
@ 2017-04-05  8:29 ` Andreas Krebbel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Krebbel @ 2017-04-05  8:29 UTC (permalink / raw)
  To: vogt, gcc-patches

On 04/05/2017 12:08 AM, Dominik Vogt wrote:
> The attached patch fixes PR 79890.  Bootstrapped and regression
> tested on s390x biarch and s390.

Applied.  Thanks!

-Andreas-


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-05  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 22:08 [PATCH] PR target/79890: S/390: Fix crash Dominik Vogt
2017-04-05  8:29 ` Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).