Don't dump low gimple functions in gimple dump
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Jun 2015 08:57:50 +0000 (08:57 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 8 Jun 2015 08:57:50 +0000 (08:57 +0000)
2015-06-08  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/66436
* cgraphunit.c (cgraph_node::analyze): Don't dump function to gimple
dump file.
* gimplify.c: Add tree-dump.h include.
(gimplify_function_tree): Dump function to gimple dump file.
* stor-layout.c (finalize_size_functions): Don't dump function to gimple
dump file.

* gcc.dg/gomp/dump-new-function-2.c: New test.
* gcc.dg/gomp/dump-new-function-3.c: Same.
* gcc.dg/gomp/dump-new-function.c: Same.

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

gcc/ChangeLog
gcc/cgraphunit.c
gcc/gimplify.c
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gomp/dump-new-function-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/gomp/dump-new-function-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/gomp/dump-new-function.c [new file with mode: 0644]

index bd1c4b0..a6d3a1e 100644 (file)
@@ -1,5 +1,15 @@
 2015-06-08  Tom de Vries  <tom@codesourcery.com>
 
+       PR tree-optimization/66436
+       * cgraphunit.c (cgraph_node::analyze): Don't dump function to gimple
+       dump file.
+       * gimplify.c: Add tree-dump.h include.
+       (gimplify_function_tree): Dump function to gimple dump file.
+       * stor-layout.c (finalize_size_functions): Don't dump function to gimple
+       dump file.
+
+2015-06-08  Tom de Vries  <tom@codesourcery.com>
+
        PR tree-optimization/66435
        * cgraphunit.c (cgraph_node::add_new_function): Dump message on new
        function.
index 6a1f0c1..c1da988 100644 (file)
@@ -652,7 +652,6 @@ cgraph_node::analyze (void)
         body.  */
       if (!gimple_has_body_p (decl))
        gimplify_function_tree (decl);
-      dump_function (TDI_generic, decl);
 
       /* Lower the function.  */
       if (!lowered)
index da5fb19..6d4618a 100644 (file)
@@ -82,6 +82,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-low.h"
 #include "cilk.h"
 #include "gomp-constants.h"
+#include "tree-dump.h"
 
 #include "langhooks-def.h"     /* FIXME: for lhd_set_decl_assembler_name */
 #include "tree-pass.h"         /* FIXME: only for PROP_gimple_any */
@@ -9444,6 +9445,8 @@ gimplify_function_tree (tree fndecl)
   cfun->curr_properties |= PROP_gimple_any;
 
   pop_cfun ();
+
+  dump_function (TDI_generic, fndecl);
 }
 
 /* Return a dummy expression of type TYPE in order to keep going after an
index 88ab36f..09b95a4 100644 (file)
@@ -316,7 +316,6 @@ finalize_size_functions (void)
       set_cfun (NULL);
       dump_function (TDI_original, fndecl);
       gimplify_function_tree (fndecl);
-      dump_function (TDI_generic, fndecl);
       cgraph_node::finalize_function (fndecl, false);
     }
 
index 913bd03..3231e7d 100644 (file)
@@ -1,5 +1,12 @@
 2015-06-08  Tom de Vries  <tom@codesourcery.com>
 
+       PR tree-optimization/66436
+       * gcc.dg/gomp/dump-new-function-2.c: New test.
+       * gcc.dg/gomp/dump-new-function-3.c: Same.
+       * gcc.dg/gomp/dump-new-function.c: Same.
+
+2015-06-08  Tom de Vries  <tom@codesourcery.com>
+
        PR tree-optimization/66435
        * gcc.dg/gomp/notify-new-function-2.c: New test.
        * gcc.dg/gomp/notify-new-function-3.c: Same.
diff --git a/gcc/testsuite/gcc.dg/gomp/dump-new-function-2.c b/gcc/testsuite/gcc.dg/gomp/dump-new-function-2.c
new file mode 100644 (file)
index 0000000..627d067
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -fdump-tree-gimple" } */
+
+void __attribute__((noinline))
+baz (int *p)
+{
+}
+
+void
+foo (void)
+{
+  int p[2];
+  p[0] = 1;
+  p[1] = 3;
+  #pragma omp task firstprivate (p)
+    baz (p);
+}
+
+/* Check that new function does not end up in gimple dump.  */
+/* { dg-final { scan-tree-dump-not "foo\\._omp_cpyfn\\.1 \\(struct" "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/dump-new-function-3.c b/gcc/testsuite/gcc.dg/gomp/dump-new-function-3.c
new file mode 100644 (file)
index 0000000..1854179
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-gimple" } */
+
+void
+foo (int *__restrict a, int *__restrict b, int *__restrict c)
+{
+  int i;
+  for (i = 0; i < 1000; ++i)
+    c[i] = a[i] + b[i];
+}
+
+/* Check that new function does not end up in gimple dump.  */
+/* { dg-final { scan-tree-dump-not "foo\\._loopfn\\.0" "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/gomp/dump-new-function.c b/gcc/testsuite/gcc.dg/gomp/dump-new-function.c
new file mode 100644 (file)
index 0000000..2814260
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -fdump-tree-gimple" } */
+
+int
+main (void)
+{
+#pragma omp parallel
+  {
+    extern void foo (void);
+    foo ();
+  }
+  return 0;
+}
+
+/* Check that new function does not end up in gimple dump.  */
+/* { dg-final { scan-tree-dump-not "main\\._omp_fn\\.0" "gimple" } } */