public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] S/390: Fix PR80725.
@ 2017-05-24 11:40 Andreas Krebbel
  2017-05-24 11:44 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Krebbel @ 2017-05-24 11:40 UTC (permalink / raw)
  To: gcc-patches

No regressions on s390x. Applied to mainline.
Ok for GCC 7 branch as well?

Bye,

-Andreas-

gcc/ChangeLog:

2017-05-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	PR target/80725
	* config/s390/s390.c (s390_check_qrst_address): Check incoming
	address against address_operand predicate.
	* config/s390/s390.md ("*indirect_jump"): Swap alternatives.

gcc/testsuite/ChangeLog:

2017-05-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.target/s390/pr80725.c: New test.
---
 gcc/config/s390/s390.c                  |  3 +++
 gcc/config/s390/s390.md                 | 10 ++++++----
 gcc/testsuite/gcc.target/s390/pr80725.c | 26 ++++++++++++++++++++++++++
 3 files changed, 35 insertions(+), 4 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/s390/pr80725.c

diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index c16391a..7be22d9 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -3102,6 +3102,9 @@ s390_check_qrst_address (char c, rtx op, bool lit_pool_ok)
   struct s390_address addr;
   bool decomposed = false;
 
+  if (!address_operand (op, GET_MODE (op)))
+    return 0;
+
   /* This check makes sure that no symbolic address (except literal
      pool references) are accepted by the R or T constraints.  */
   if (s390_loadrelative_operand_p (op, NULL, NULL))
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index c9fd19a..cfae171 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -9660,14 +9660,16 @@
     operands[0] = force_reg (Pmode, operands[0]);
 })
 
+; The first constraint must be an "extra address constraint" in order
+; to trigger address reloading in LRA/reload
 (define_insn "*indirect_jump"
   [(set (pc)
-	(match_operand 0 "address_operand" "a,ZR"))]
+	(match_operand 0 "address_operand" "ZR,a"))]
  ""
  "@
-  br\t%0
-  b\t%a0"
- [(set_attr "op_type" "RR,RX")
+  b\t%a0
+  br\t%0"
+ [(set_attr "op_type" "RX,RR")
   (set_attr "type"  "branch")
   (set_attr "atype" "agen")
   (set_attr "cpu_facility" "*")])
diff --git a/gcc/testsuite/gcc.target/s390/pr80725.c b/gcc/testsuite/gcc.target/s390/pr80725.c
new file mode 100644
index 0000000..4a402c4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr80725.c
@@ -0,0 +1,26 @@
+/* Regression test for PR/80725.  */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=zEC12" } */
+
+int a, e;
+const char b;
+char c;
+const int d;
+void bar (short);
+
+void
+foo (int x, int y)
+{
+  long f = d;
+  short g = 0;
+  while (e)
+    while (a < x)
+      {
+	if (y)
+	  goto *d;
+	g = b | b + g;
+	bar (g);
+	c = (char) (long) foo;
+      }
+}
-- 
2.9.1

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

* Re: [Committed] S/390: Fix PR80725.
  2017-05-24 11:40 [Committed] S/390: Fix PR80725 Andreas Krebbel
@ 2017-05-24 11:44 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2017-05-24 11:44 UTC (permalink / raw)
  To: Andreas Krebbel; +Cc: gcc-patches

On Wed, May 24, 2017 at 01:38:01PM +0200, Andreas Krebbel wrote:
> No regressions on s390x. Applied to mainline.
> Ok for GCC 7 branch as well?

Ok, (though, you don't really need a permission for that, maintainers
can decide on backports to release branches themselves except when
the branches are frozen).

> 2017-05-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	PR target/80725
> 	* config/s390/s390.c (s390_check_qrst_address): Check incoming
> 	address against address_operand predicate.
> 	* config/s390/s390.md ("*indirect_jump"): Swap alternatives.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-05-24  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* gcc.target/s390/pr80725.c: New test.

	Jakub

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

end of thread, other threads:[~2017-05-24 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24 11:40 [Committed] S/390: Fix PR80725 Andreas Krebbel
2017-05-24 11:44 ` Jakub Jelinek

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).