From b82d426662469ee8b78ec7e8f74abe950485c9d5 Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Thu, 20 Feb 2020 11:08:02 -0600 Subject: [PATCH] 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. gcc/ PR target/93658 * config/rs6000/rs6000.c (rs6000_legitimate_address_p): Handle VSX vector modes. gcc/testsuite/ PR target/93658 * gcc.target/powerpc/pr93658.c: New test. --- gcc/testsuite/gcc.target/powerpc/pr93658.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr93658.c 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 (); +} -- 2.30.2