From 88d91afd827b2861aae06ea759140fa71eaea094 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 8 Jun 2015 08:57:50 +0000 Subject: [PATCH] Don't dump low gimple functions in gimple dump 2015-06-08 Tom de Vries 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. From-SVN: r224210 --- gcc/ChangeLog | 10 ++++++++++ gcc/cgraphunit.c | 1 - gcc/gimplify.c | 3 +++ gcc/stor-layout.c | 1 - gcc/testsuite/ChangeLog | 7 +++++++ .../gcc.dg/gomp/dump-new-function-2.c | 20 +++++++++++++++++++ .../gcc.dg/gomp/dump-new-function-3.c | 13 ++++++++++++ gcc/testsuite/gcc.dg/gomp/dump-new-function.c | 16 +++++++++++++++ 8 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/gomp/dump-new-function-2.c create mode 100644 gcc/testsuite/gcc.dg/gomp/dump-new-function-3.c create mode 100644 gcc/testsuite/gcc.dg/gomp/dump-new-function.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bd1c4b0a37c..a6d3a1ee24d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2015-06-08 Tom de Vries + + 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 PR tree-optimization/66435 diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 6a1f0c1dd2f..c1da9880d73 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -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) diff --git a/gcc/gimplify.c b/gcc/gimplify.c index da5fb1946fb..6d4618afee4 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -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 diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 88ab36f55f2..09b95a4c2c3 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -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); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 913bd036e9a..3231e7db463 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-06-08 Tom de Vries + + 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 PR tree-optimization/66435 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 index 00000000000..627d0676ce3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/dump-new-function-2.c @@ -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 index 00000000000..1854179eded --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/dump-new-function-3.c @@ -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 index 00000000000..2814260cf37 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/dump-new-function.c @@ -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" } } */ -- 2.30.2