The test's expectation of shrink-wrapping is only met starting at
power6.  At earlier CPUs, the register allocator prefers to preserve
an incoming argument around a call in a call-saved register, rather
than in a stack slot, and that prevents shrink-wrapping.

Tested with gcc-14 targeting ppc-vx7r2 and ppc64-vx7r2.  Also tested
with trunk on ppc64le-linux-gnu, and with gcc-14 targeting powerpc-elf.
Ok to install?


for  gcc/testsuite/ChangeLog

        * gcc.target/powerpc/pr110071.c: Expect shrink-wrapping
        starting at power6.
---
 gcc/testsuite/gcc.target/powerpc/pr110071.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/pr110071.c 
b/gcc/testsuite/gcc.target/powerpc/pr110071.c
index 282349c744425..0548e8bfa790d 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr110071.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr110071.c
@@ -12,4 +12,6 @@ foo (long i, long cond)
   return i+1;
 }
 
-/* { dg-final { scan-rtl-dump-times "Performing shrink-wrapping" 1 
"pro_and_epilogue" } } */
+/* Before power6, i is preserved in a call-saved register rather than in
+   memory, which prevents shrink-wrapping.  */
+/* { dg-final { scan-rtl-dump-times "Performing shrink-wrapping" 1 
"pro_and_epilogue" { target has_arch_pwr6 } } } */

-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to