aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
authorKewen Lin <linkw@linux.ibm.com>2022-09-26 00:33:18 -0500
committerKewen Lin <linkw@linux.ibm.com>2022-10-19 02:54:35 -0500
commitc7f17493cc26a4395d549547075603a15f4c94a7 (patch)
tree37b0050145056e81af91e5e3cdb13c6d42d686c4 /gcc/testsuite/gcc.target
parent6db4ba9750ffd65c80995425db0d5f1020a04b28 (diff)
downloadgcc-c7f17493cc26a4395d549547075603a15f4c94a7.zip
gcc-c7f17493cc26a4395d549547075603a15f4c94a7.tar.gz
gcc-c7f17493cc26a4395d549547075603a15f4c94a7.tar.bz2
rs6000: Fix the condition with frame_pointer_needed_indeed [PR96072]
As PR96072 shows, the code adding REG_CFA_DEF_CFA reg note makes one assumption that we have emitted one insn which restores the frame pointer previously. That part of code was guarded with flag frame_pointer_needed before, it was consistent, but it was replaced with flag frame_pointer_needed_indeed since commit r10-7981. It caused ICE due to unexpected NULL insn. PR target/96072 gcc/ChangeLog: * config/rs6000/rs6000-logue.cc (rs6000_emit_epilogue): Update the condition for adding REG_CFA_DEF_CFA reg note with frame_pointer_needed_indeed. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr96072.c: New test. (cherry picked from commit 5be0950d22209f5ba69d244387228e12389a8470)
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr96072.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/pr96072.c b/gcc/testsuite/gcc.target/powerpc/pr96072.c
new file mode 100644
index 0000000..10341c9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr96072.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O2" } */
+
+/* This used to ICE with the SYSV ABI (PR96072). */
+
+void
+he (int jn)
+{
+ {
+ int bh[jn];
+ if (jn != 0)
+ goto wa;
+ }
+wa:;
+}