diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2010-07-22 22:18:07 -0400 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2010-07-22 22:18:07 -0400 |
commit | 9d3493e63d87f3cbd0c3caab3b429583f8b6c7b6 (patch) | |
tree | 6fd09db5a597af1fbdf4a2464a186b333c1009c6 | |
parent | 944be25bc5fec42efdd1fa5c0a5a0a1047342827 (diff) | |
download | gcc-9d3493e63d87f3cbd0c3caab3b429583f8b6c7b6.zip gcc-9d3493e63d87f3cbd0c3caab3b429583f8b6c7b6.tar.gz gcc-9d3493e63d87f3cbd0c3caab3b429583f8b6c7b6.tar.bz2 |
re PR tree-optimization/39839 (loop invariant motion causes stack spill)
2010-07-22 Sandra Loosemore <sandra@codesourcery.com>
PR tree-optimization/39839
gcc/testsuite/
* gcc.target/arm/pr39839.c: New test case.
From-SVN: r162438
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/arm/pr39839.c | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ecb1efb..dfcd727 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-07-22 Sandra Loosemore <sandra@codesourcery.com> + + PR tree-optimization/39839 + * gcc.target/arm/pr39839.c: New test case. + 2010-07-22 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/unchecked_convert5b.adb: New test. diff --git a/gcc/testsuite/gcc.target/arm/pr39839.c b/gcc/testsuite/gcc.target/arm/pr39839.c new file mode 100644 index 0000000..31e865a --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr39839.c @@ -0,0 +1,24 @@ +/* { dg-options "-mthumb -Os -march=armv5te -mthumb-interwork -fpic" } */ +/* { dg-require-effective-target arm_thumb1_ok } */ +/* { dg-final { scan-assembler-not "str\[\\t \]*r.,\[\\t \]*.sp," } } */ + +struct S +{ + int count; + char *addr; +}; + +void func(const char*, const char*, int, const char*); + +/* This function should not need to spill to the stack. */ +void test(struct S *p) +{ + int off = p->count; + while (p->count >= 0) + { + const char *s = "xyz"; + if (*p->addr) s = "pqr"; + func("abcde", p->addr + off, off, s); + p->count--; + } +} |