aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2017-06-09 05:46:08 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2017-06-09 05:46:08 +0200
commit120ef1d50ab7fe53a67fb2026374b2bdd67838bd (patch)
tree705e42d50783725696c7140aee6b70afcf3ba82c /gcc/testsuite
parentff67045361eb84325e54c38c84cae2df9859bfd3 (diff)
downloadgcc-120ef1d50ab7fe53a67fb2026374b2bdd67838bd.zip
gcc-120ef1d50ab7fe53a67fb2026374b2bdd67838bd.tar.gz
gcc-120ef1d50ab7fe53a67fb2026374b2bdd67838bd.tar.bz2
rs6000: Don't add an immediate to r0 (PR80966)
If there is a large stack frame the rs6000 -fstack-limit code would calculate the new stack pointer value using two insns (an addis and an addi), with r0 as temporary. Such instructions do not exist. This patch changes add<mode>3 to expand using a different strategy in such cases; to FAIL if there is no way to do it (namely, if the source is r0 and there is no way to get a temporary reg); and it changes rs6000_emit_allocate_stack to assert gen_add3_insn did in fact emit instructions. PR target/80966 * config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that gen_add3_insn did not fail. * config/rs6000/rs6000.md (add<mode>3): If asked to add a constant to r0, construct that number in a temporary reg and add that reg to r0. If asked to put the result in r0 as well, fail. gcc/testsuite/ * gcc.target/powerpc/stack-limit.c: New testcase. From-SVN: r249046
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/powerpc/stack-limit.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7b0e74a..9855db5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-09 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/80966
+ * gcc.target/powerpc/stack-limit.c: New testcase.
+
2017-06-08 Will Schmidt <will_schmidt@vnet.ibm.com>
* testsuite/gcc.target/powerpc/fold-vec-logical-eqv-char.c: New.
diff --git a/gcc/testsuite/gcc.target/powerpc/stack-limit.c b/gcc/testsuite/gcc.target/powerpc/stack-limit.c
new file mode 100644
index 0000000..e676c96
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/stack-limit.c
@@ -0,0 +1,10 @@
+/* { dg-options "-O0 -fstack-limit-register=r14" } */
+
+// PR80966
+
+int foo (int i)
+{
+ char arr[135000];
+
+ arr[i] = 0;
+}