From 3f1ae7424c7600eb1033e871d6095a5fe3f81555 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Wed, 4 Jul 2012 15:49:19 +0200 Subject: [PATCH] re PR middle-end/53321 (LTO bootstrap failed with bootstrap-profiled) PR middle-end/53321 * ipa.c (symtab_remove_unreachable_nodes): Partially revert r187375 to not call cgraph_propagate_frequency if something was changed. testsuite/ChangLog: PR middle-end/53321 * g++.dg/torture/pr53321.C: New test. From-SVN: r189261 --- gcc/ChangeLog | 8 +++++- gcc/ipa.c | 5 ---- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.dg/torture/pr53321.C | 36 ++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr53321.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6f8a34f3338..3c3ba0ed321 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-07-04 Uros Bizjak + + PR middle-end/53321 + * ipa.c (symtab_remove_unreachable_nodes): Partially revert r187375 + to not call cgraph_propagate_frequency if something was changed. + 2012-07-04 Richard Guenther PR middle-end/53433 @@ -31,7 +37,7 @@ as in free_lang_data_in_type. 2012-07-04 Tobias Grosser - Michael Matz + Michael Matz * Makefile.in (OBJS): Add graphite-optimize-isl.o. (graphite-optimize-isl.o): Add dependencies. diff --git a/gcc/ipa.c b/gcc/ipa.c index f5cce1ba41a..09351a79c2e 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -449,11 +449,6 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file) verify_symtab (); #endif - /* If we removed something, perhaps profile could be improved. */ - if (changed && optimize && inline_edge_summary_vec) - FOR_EACH_DEFINED_FUNCTION (node) - cgraph_propagate_frequency (node); - return changed; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3d1fda9e16c..2833385b50a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-07-04 Uros Bizjak + + PR middle-end/53321 + * g++.dg/torture/pr53321.C: New test. + 2012-07-04 Richard Guenther PR tree-optimization/53844 diff --git a/gcc/testsuite/g++.dg/torture/pr53321.C b/gcc/testsuite/g++.dg/torture/pr53321.C new file mode 100644 index 00000000000..40a2de731d7 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr53321.C @@ -0,0 +1,36 @@ +// { dg-do compile } +// { dg-require-profiling "-fprofile-generate" } +// { dg-options "-fprofile-generate" } + +typedef long unsigned int size_t; + +extern "C" +{ + extern void *memcpy (void *__dest, __const void *__src, size_t __n); +} + +extern char *src, *sources; +extern int n_sources; + +static void +find_source (const char *file_name) +{ + memcpy (src, sources, n_sources * sizeof (*sources)); +} + +extern const char *gcov_read_string (void); + +static void read_graph_file (void) +{ + find_source (gcov_read_string ()); +} + +static void process_file (void) +{ + read_graph_file (); +} + +int main () +{ + process_file (); +}