PR tree-optimization/23818
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Sep 2005 15:29:42 +0000 (15:29 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Sep 2005 15:29:42 +0000 (15:29 +0000)
* tree-stdarg.c (execute_optimize_stdarg): Call
calculate_dominance_info.

* gcc.dg/pr23818.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104455 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr23818.c [new file with mode: 0644]
gcc/tree-stdarg.c

index 5051fd6..3a6a8dd 100644 (file)
@@ -1,3 +1,9 @@
+2005-09-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/23818
+       * tree-stdarg.c (execute_optimize_stdarg): Call
+       calculate_dominance_info.
+
 2005-09-18  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-data-ref.c (get_number_of_iters_for_loop): New function.
index f91da85..e456199 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/23818
+       * gcc.dg/pr23818.c: New test.
+
 2005-09-20  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
 
        PR fortran/23420
diff --git a/gcc/testsuite/gcc.dg/pr23818.c b/gcc/testsuite/gcc.dg/pr23818.c
new file mode 100644 (file)
index 0000000..be0bb9a
--- /dev/null
@@ -0,0 +1,33 @@
+/* PR tree-optimization/23818 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-dominator-opts" } */
+
+#include <stdarg.h>
+
+extern void abort (void);
+
+void
+foo (int p[100], int k, ...)
+{
+  int j, *q;
+  va_list ap;
+
+  va_start (ap, k);
+  q = va_arg (ap, int *);
+  for (j = 0; j < 100; j++)
+    q[j] = p[j] + 10;
+  va_end(ap);
+}
+
+int
+main (void)
+{
+  int buf[100], buf2[100], i;
+  for (i = 0; i < 100; i++)
+    buf[i] = i + 1;
+  foo (buf, 0, buf2);
+  for (i = 0; i < 100; i++)
+    if (buf2[i] != buf[i] + 10)
+      abort ();
+  return 0;
+}
index a744658..c68e7b5 100644 (file)
@@ -734,6 +734,8 @@ execute_optimize_stdarg (void)
   if (va_list_simple_ptr)
     cfun->va_list_fpr_size = VA_LIST_MAX_FPR_SIZE;
 
+  calculate_dominance_info (CDI_DOMINATORS);
+
   FOR_EACH_BB (bb)
     {
       block_stmt_iterator i;