+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.
--- /dev/null
+/* { 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--;
+ }
+}