aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-10-12 08:01:37 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-10-12 06:01:37 +0000
commit86b7136a66a19238434916c6a6f5e9fe1c4ad54e (patch)
treea5b3c3834396fa658594fafb09a7a37b30a7b896 /gcc
parent38e9e539bc63af71d76c3d5292fb08bb8262a5bf (diff)
downloadgcc-86b7136a66a19238434916c6a6f5e9fe1c4ad54e.zip
gcc-86b7136a66a19238434916c6a6f5e9fe1c4ad54e.tar.gz
gcc-86b7136a66a19238434916c6a6f5e9fe1c4ad54e.tar.bz2
tree-profile.c (tree_profiling): Do not clear pure/const when not instrumenting.
* tree-profile.c (tree_profiling): Do not clear pure/const when not instrumenting. (pass tree_profile): Add dump of symtab. From-SVN: r228702
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-profile.c31
2 files changed, 22 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7ba2cf9..931dede 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2015-10-11 Jan Hubicka <hubicka@ucw.cz>
+ * tree-profile.c (tree_profiling): Do not clear
+ pure/const when not instrumenting.
+ (pass tree_profile): Add dump of symtab.
+
+2015-10-11 Jan Hubicka <hubicka@ucw.cz>
+
* fold-const.c (fold_comparsion): Pass OEP_ADDRESS_OF when comparing
addresses.
(fold_addr_of_array_ref_difference): Likewise.
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index b4b3ae1..2b11554 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -564,20 +564,21 @@ tree_profiling (void)
}
/* Drop pure/const flags from instrumented functions. */
- FOR_EACH_DEFINED_FUNCTION (node)
- {
- if (!gimple_has_body_p (node->decl)
- || !(!node->clone_of
- || node->decl != node->clone_of->decl))
- continue;
-
- /* Don't profile functions produced for builtin stuff. */
- if (DECL_SOURCE_LOCATION (node->decl) == BUILTINS_LOCATION)
- continue;
-
- node->set_const_flag (false, false);
- node->set_pure_flag (false, false);
- }
+ if (profile_arc_flag || flag_test_coverage)
+ FOR_EACH_DEFINED_FUNCTION (node)
+ {
+ if (!gimple_has_body_p (node->decl)
+ || !(!node->clone_of
+ || node->decl != node->clone_of->decl))
+ continue;
+
+ /* Don't profile functions produced for builtin stuff. */
+ if (DECL_SOURCE_LOCATION (node->decl) == BUILTINS_LOCATION)
+ continue;
+
+ node->set_const_flag (false, false);
+ node->set_pure_flag (false, false);
+ }
/* Update call statements and rebuild the cgraph. */
FOR_EACH_DEFINED_FUNCTION (node)
@@ -633,7 +634,7 @@ const pass_data pass_data_ipa_tree_profile =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0, /* todo_flags_finish */
+ TODO_dump_symtab, /* todo_flags_finish */
};
class pass_ipa_tree_profile : public simple_ipa_opt_pass