This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Another testcase for PR43560


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]