From 135a171d9eac312352f58e0c09abac9156d9fbda Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 19 Jan 2008 18:49:46 +0100 Subject: 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 --- gcc/omp-low.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/omp-low.c') diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 94d63b6..ca00266 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -2497,6 +2497,9 @@ expand_omp_parallel (struct omp_region *region) entry_stmt = last_stmt (region->entry); child_fn = OMP_PARALLEL_FN (entry_stmt); child_cfun = DECL_STRUCT_FUNCTION (child_fn); + /* If this function has been already instrumented, make sure + the child function isn't instrumented again. */ + child_cfun->after_tree_profile = cfun->after_tree_profile; entry_bb = region->entry; exit_bb = region->exit; @@ -3337,6 +3340,16 @@ expand_omp_for (struct omp_region *region) extract_omp_for_data (last_stmt (region->entry), &fd); region->sched_kind = fd.sched_kind; + gcc_assert (EDGE_COUNT (region->entry->succs) == 2); + BRANCH_EDGE (region->entry)->flags &= ~EDGE_ABNORMAL; + FALLTHRU_EDGE (region->entry)->flags &= ~EDGE_ABNORMAL; + if (region->cont) + { + gcc_assert (EDGE_COUNT (region->cont->succs) == 2); + BRANCH_EDGE (region->cont)->flags &= ~EDGE_ABNORMAL; + FALLTHRU_EDGE (region->cont)->flags &= ~EDGE_ABNORMAL; + } + if (fd.sched_kind == OMP_CLAUSE_SCHEDULE_STATIC && !fd.have_ordered && region->cont != NULL) -- cgit v1.1