tree-profile.c (tree_profiling): Do not clear pure/const when not instrumenting.
authorJan Hubicka <hubicka@ucw.cz>
Mon, 12 Oct 2015 06:01:37 +0000 (08:01 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 12 Oct 2015 06:01:37 +0000 (06:01 +0000)
* tree-profile.c (tree_profiling): Do not clear
pure/const when not instrumenting.
(pass tree_profile): Add dump of symtab.

From-SVN: r228702

gcc/ChangeLog
gcc/tree-profile.c

index 7ba2cf9cf65cfde316ee280a15f0cd2c1beef513..931dedeec604e40e4eeff7c671ab3e113fd4fa5e 100644 (file)
@@ -1,3 +1,9 @@
+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
index b4b3ae19c99b04331858d62fe2c13dd6e5cb84fc..2b115544b55790cd967c014fcd55afdaa6d73424 100644 (file)
@@ -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