From 0b9066cf56f688034561c58adb5cadaf102abb26 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 4 Apr 2012 12:12:00 +0000 Subject: [PATCH] re PR bootstrap/52808 (LTO bootstrap failed with bootstrap-profiled) 2012-04-04 Richard Guenther PR tree-optimization/52808 * tracer.c (tail_duplicate): Do not tail-duplicate loop header blocks. * Makefile.in (tracer.o): Depend on $(CFGLOOP_H). From-SVN: r186135 --- gcc/ChangeLog | 7 +++++++ gcc/Makefile.in | 2 +- gcc/tracer.c | 9 ++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 970fb7ff3da..70f59a49150 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-04-04 Richard Guenther + + PR tree-optimization/52808 + * tracer.c (tail_duplicate): Do not tail-duplicate loop header + blocks. + * Makefile.in (tracer.o): Depend on $(CFGLOOP_H). + 2012-04-04 Tristan Gingold * expr.c (expand_expr_real_2): Handle larger sizetype in diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 8fd82089563..9c4d4fe22c6 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3391,7 +3391,7 @@ bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h $(CFGLAYOUT_H) \ $(FLAGS_H) $(TIMEVAR_H) $(PARAMS_H) $(COVERAGE_H) $(FIBHEAP_H) \ - $(TREE_PASS_H) $(TREE_FLOW_H) $(TREE_INLINE_H) + $(TREE_PASS_H) $(TREE_FLOW_H) $(TREE_INLINE_H) $(CFGLOOP_H) cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \ $(FUNCTION_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(TARGET_H) gt-cfglayout.h \ diff --git a/gcc/tracer.c b/gcc/tracer.c index 8fb9817dbe9..ce95f56bbbe 100644 --- a/gcc/tracer.c +++ b/gcc/tracer.c @@ -52,6 +52,7 @@ #include "tree-pass.h" #include "tree-flow.h" #include "tree-inline.h" +#include "cfgloop.h" static int count_insns (basic_block); static bool ignore_bb_p (const_basic_block); @@ -307,7 +308,13 @@ tail_duplicate (void) } traced_insns += bb2->frequency * counts [bb2->index]; if (EDGE_COUNT (bb2->preds) > 1 - && can_duplicate_block_p (bb2)) + && can_duplicate_block_p (bb2) + /* We have the tendency to duplicate the loop header + of all do { } while loops. Do not do that - it is + not profitable and it might create a loop with multiple + entries or at least rotate the loop. */ + && (!current_loops + || bb2->loop_father->header != bb2)) { edge e; basic_block copy;