Daily bump.
[platform/upstream/gcc.git] / gcc / tree-profile.c
index 6c08382..cf46912 100644 (file)
@@ -1,5 +1,5 @@
 /* Calculate branch probabilities, and basic block execution counts.
-   Copyright (C) 1990-2020 Free Software Foundation, Inc.
+   Copyright (C) 1990-2021 Free Software Foundation, Inc.
    Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
    based on some ideas from Dain Samples of UC Berkeley.
    Further mangling by Bob Manson, Cygnus Support.
@@ -55,6 +55,9 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "stor-layout.h"
 #include "xregex.h"
+#include "alloc-pool.h"
+#include "symbol-summary.h"
+#include "symtab-thunks.h"
 
 static GTY(()) tree gcov_type_node;
 static GTY(()) tree tree_interval_profiler_fn;
@@ -247,7 +250,7 @@ gimple_gen_edge_profiler (int edgeno, edge e)
     {
       /* __atomic_fetch_add (&counter, 1, MEMMODEL_RELAXED); */
       tree addr = tree_coverage_counter_addr (GCOV_COUNTER_ARCS, edgeno);
-      tree f = builtin_decl_explicit (LONG_LONG_TYPE_SIZE > 32
+      tree f = builtin_decl_explicit (TYPE_PRECISION (gcov_type_node) > 32
                                      ? BUILT_IN_ATOMIC_FETCH_ADD_8:
                                      BUILT_IN_ATOMIC_FETCH_ADD_4);
       gcall *stmt = gimple_build_call (f, 3, addr, one,
@@ -522,7 +525,7 @@ gimple_gen_time_profiler (unsigned tag)
                          tree_time_profiler_counter);
       gassign *assign = gimple_build_assign (ptr, NOP_EXPR, addr);
       gsi_insert_before (&gsi, assign, GSI_NEW_STMT);
-      tree f = builtin_decl_explicit (LONG_LONG_TYPE_SIZE > 32
+      tree f = builtin_decl_explicit (TYPE_PRECISION (gcov_type_node) > 32
                                      ? BUILT_IN_ATOMIC_ADD_FETCH_8:
                                      BUILT_IN_ATOMIC_ADD_FETCH_4);
       gcall *stmt = gimple_build_call (f, 3, ptr, one,
@@ -726,7 +729,7 @@ tree_profiling (void)
   FOR_EACH_DEFINED_FUNCTION (node)
     {
       bool thunk = false;
-      if (!gimple_has_body_p (node->decl) && !node->thunk.thunk_p)
+      if (!gimple_has_body_p (node->decl) && !node->thunk)
        continue;
 
       /* Don't profile functions produced for builtin stuff.  */
@@ -747,7 +750,7 @@ tree_profiling (void)
       if (!include_source_file_for_profile (file))
        continue;
 
-      if (node->thunk.thunk_p)
+      if (node->thunk)
        {
          /* We cannot expand variadic thunks to Gimple.  */
          if (stdarg_p (TREE_TYPE (node->decl)))
@@ -756,7 +759,7 @@ tree_profiling (void)
          /* When generate profile, expand thunk to gimple so it can be
             instrumented same way as other functions.  */
          if (profile_arc_flag)
-           node->expand_thunk (false, true);
+           expand_thunk (node, false, true);
          /* Read cgraph profile but keep function as thunk at profile-use
             time.  */
          else