This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Another testcase for PR43560
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 Apr 2010 12:29:13 +0200
- Subject: [committed] Another testcase for PR43560
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
I've committed this testcase distilled from OO.o that has been
fixed by PR43560 too to 4.6/4.5/4.4 after Richi's approval in the PR.
2010-04-12 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/43560
* gcc.c-torture/execute/pr43560.c: New test.
--- gcc/testsuite/gcc.c-torture/execute/pr43560.c.jj 2010-04-12 12:05:10.000000000 +0200
+++ gcc/testsuite/gcc.c-torture/execute/pr43560.c 2010-04-12 12:04:50.000000000 +0200
@@ -0,0 +1,28 @@
+/* PR tree-optimization/43560 */
+
+struct S
+{
+ int a, b;
+ char c[10];
+};
+
+__attribute__ ((noinline)) void
+test (struct S *x)
+{
+ while (x->b > 1 && x->c[x->b - 1] == '/')
+ {
+ x->b--;
+ x->c[x->b] = '\0';
+ }
+}
+
+const struct S s = { 0, 0, "" };
+
+int
+main ()
+{
+ struct S *p;
+ asm ("" : "=r" (p) : "0" (&s));
+ test (p);
+ return 0;
+}
Jakub