]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/43560 (possible wrong code bug)
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Apr 2010 10:18:39 +0000 (12:18 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Apr 2010 10:18:39 +0000 (12:18 +0200)
PR tree-optimization/43560
* gcc.c-torture/execute/pr43560.c: New test.

From-SVN: r158220

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr43560.c [new file with mode: 0644]

index 1af06733c4774b6b76b4d4718af12958f1f85dff..fe70fb42424e0d3c9ac7b0b08cfa2e628277b354 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/43560
+       * gcc.c-torture/execute/pr43560.c: New test.
+
 2010-04-12  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/aggr13.adb: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr43560.c b/gcc/testsuite/gcc.c-torture/execute/pr43560.c
new file mode 100644 (file)
index 0000000..cb420c6
--- /dev/null
@@ -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;
+}