public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-9-branch)] rs6000: Fix infinite loop building ghostscript and icu [PR93658]
@ 2020-03-17 19:14 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-03-17 19:14 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:066184a282b622ac6880150eb4e42fe57881b606

commit 066184a282b622ac6880150eb4e42fe57881b606
Author: Peter Bergner <bergner@linux.ibm.com>
Date:   Sun Feb 23 18:22:57 2020 -0600

    rs6000: Fix infinite loop building ghostscript and icu [PR93658]
    
    Fix rs6000_legitimate_address_p(), which erroneously marks a valid Altivec
    address as being invalid, which causes LRA's process_address()  to go into
    an infinite loop spilling the same address over and over again.
    Include Mike's earlier commits that fix bugs this patch exposes.
    
            Backport from master
            2020-02-20  Peter Bergner  <bergner@linux.ibm.com>
    
            PR target/93658
            * config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX
            vector modes.
    
            * gcc.target/powerpc/pr93658.c: New test.

Diff:
---
 gcc/ChangeLog                              |  9 +++++++++
 gcc/config/rs6000/rs6000.c                 |  2 +-
 gcc/testsuite/ChangeLog                    |  8 ++++++++
 gcc/testsuite/gcc.target/powerpc/pr93658.c | 20 ++++++++++++++++++++
 4 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ec6600af088..8d8dbc0bdff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2020-02-23  Peter Bergner <bergner@linux.ibm.com>
+
+	Backport from master
+	2020-02-20  Peter Bergner  <bergner@linux.ibm.com>
+
+	PR target/93658
+	* config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX
+	vector modes.
+
 2020-02-23  Peter Bergner <bergner@linux.ibm.com>
 
 	Backport from master
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ce1bd3262d1..1d93570e7a5 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -9358,7 +9358,7 @@ rs6000_legitimate_address_p (machine_mode mode, rtx x, bool reg_ok_strict)
   bool quad_offset_p = mode_supports_dq_form (mode);
 
   /* If this is an unaligned stvx/ldvx type address, discard the outer AND.  */
-  if (VECTOR_MEM_ALTIVEC_P (mode)
+  if (VECTOR_MEM_ALTIVEC_OR_VSX_P (mode)
       && GET_CODE (x) == AND
       && CONST_INT_P (XEXP (x, 1))
       && INTVAL (XEXP (x, 1)) == -16)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9344d00e38a..f02a9415230 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2020-02-23  Peter Bergner  <bergner@linux.ibm.com>
+
+	Backport from master
+	2020-02-20  Peter Bergner  <bergner@linux.ibm.com>
+
+	PR target/93658
+	* gcc.target/powerpc/pr93658.c: New test.
+
 2020-02-20  H.J. Lu  <hongjiu.lu@intel.com>
 
 	Backport from master
diff --git a/gcc/testsuite/gcc.target/powerpc/pr93658.c b/gcc/testsuite/gcc.target/powerpc/pr93658.c
new file mode 100644
index 00000000000..0170d34d259
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr93658.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fstack-protector-strong -mcpu=power8" } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+
+/* PR93658: Failure compiling this test is an infinite loop in LRA's
+   process_address(), so set a short timeout limit.  */
+/* { dg-timeout 5 } */
+
+void bar();
+char b;
+void
+foo (void)
+{
+  char a;
+  int d = b;
+  char *e = &a;
+  while (d)
+    *e++ = --d;
+  bar ();
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-17 19:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17 19:14 [gcc(refs/vendors/redhat/heads/gcc-9-branch)] rs6000: Fix infinite loop building ghostscript and icu [PR93658] 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).