From 248cce34f1003712c39639980d4cb549ef24834a Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 29 Nov 2016 14:20:00 +0100 Subject: [PATCH] Make one extra BB to prevent PHI argument clash (PR PR gcov-profile/78582 * gcc.dg/pr78582.c: New test. PR gcov-profile/78582 * tree-profile.c (gimple_gen_time_profiler): Make one extra BB to prevent PHI argument clash. From-SVN: r242958 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/tree-profile.c | 6 +++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e8b117986ab..feb30a8d1bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-29 Martin Liska + + PR gcov-profile/78582 + * tree-profile.c (gimple_gen_time_profiler): Make one extra BB + to prevent PHI argument clash. + 2016-11-29 Claudiu Zissulescu * config/arc/arc.opt (marclinux): Fix typo. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 101a6e0689a..62f362a65b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-29 Martin Liska + + PR gcov-profile/78582 + * gcc.dg/pr78582.c: New test. + 2016-11-29 Senthil Kumar Selvaraj * testsuite/gcc.dg/pr31096-1.c: Use __{U,}INT32_TYPE__ for diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index a4f9d11b161..77fb86e51e8 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -461,10 +461,10 @@ void gimple_gen_time_profiler (unsigned tag, unsigned base) { tree type = get_gcov_type (); - basic_block cond_bb - = split_edge (single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun))); - + basic_block entry = ENTRY_BLOCK_PTR_FOR_FN (cfun); + basic_block cond_bb = split_edge (single_succ_edge (entry)); basic_block update_bb = split_edge (single_succ_edge (cond_bb)); + split_edge (single_succ_edge (update_bb)); edge true_edge = single_succ_edge (cond_bb); true_edge->flags = EDGE_TRUE_VALUE; -- 2.30.2