aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-profile.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-01-19 18:49:46 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-01-19 18:49:46 +0100
commit135a171d9eac312352f58e0c09abac9156d9fbda (patch)
treec47ee4cdc097d5f98d818d66731d4ecf07beeff8 /gcc/tree-profile.c
parentd7e2fcd0038214e3e3d9301fa7f22cccb54de009 (diff)
downloadgcc-135a171d9eac312352f58e0c09abac9156d9fbda.zip
gcc-135a171d9eac312352f58e0c09abac9156d9fbda.tar.gz
gcc-135a171d9eac312352f58e0c09abac9156d9fbda.tar.bz2
re PR gcov-profile/34610 (ICE with "-fprofile-arcs -fopenmp")
PR gcov-profile/34610 * tree-cfg.c (make_edges): Mark both outgoing edges from OMP_CONTINUE and from OMP_FOR as EDGE_ABNORMAL. * omp-low.c (expand_omp_for): Clear EDGE_ABNORMAL bits from OMP_FOR and OMP_CONTINUE outgoing edges. * tree-profile.c (tree_profiling): Return early if cfun->after_tree_profile != 0. Set cfun->after_tree_profile at the end. * omp-low.c (expand_omp_parallel): Copy after_tree_profile from cfun to child_cfun. * function.h (struct function): Add after_tree_profile bit. * gcc.dg/gomp/pr34610.c: New test. From-SVN: r131653
Diffstat (limited to 'gcc/tree-profile.c')
-rw-r--r--gcc/tree-profile.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 95c1136..00fbd86 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -1,6 +1,6 @@
/* Calculate branch probabilities, and basic block execution counts.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
based on some ideas from Dain Samples of UC Berkeley.
@@ -419,8 +419,11 @@ static unsigned int
tree_profiling (void)
{
/* Don't profile functions produced at destruction time, particularly
- the gcov datastructure initializer. */
- if (cgraph_state == CGRAPH_STATE_FINISHED)
+ the gcov datastructure initializer. Don't profile if it has been
+ already instrumented either (when OpenMP expansion creates
+ child function from already instrumented body). */
+ if (cgraph_state == CGRAPH_STATE_FINISHED
+ || cfun->after_tree_profile)
return 0;
/* Re-set global shared temporary variable for edge-counters. */
@@ -441,6 +444,7 @@ tree_profiling (void)
easy to adjust it, if and when there is some. */
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
+ cfun->after_tree_profile = 1;
return 0;
}