]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Change the type of return value of profile_count::value to uint64_t
authorMartin Jambor <mjambor@suse.cz>
Thu, 15 Jul 2021 15:26:45 +0000 (17:26 +0200)
committerMartin Jambor <mjambor@suse.cz>
Thu, 15 Jul 2021 15:27:17 +0000 (17:27 +0200)
The field in which profile_count holds the count has 61 bits but the
getter method only returns it as a 32 bit number.  The getter is (and
should be) only used for dumping but even dumps are better when they
do not lie.

gcc/ChangeLog:

2021-07-13  Martin Jambor  <mjambor@suse.cz>

* profile-count.h (profile_count::value): Change the return type to
uint64_t.
* gimple-pretty-print.c (dump_gimple_bb_header): Adjust print
statement.
* tree-cfg.c (dump_function_to_file): Likewise.

gcc/gimple-pretty-print.c
gcc/profile-count.h
gcc/tree-cfg.c

index 39c5775e2cb1f2aa994ae21c06f881c44c9844e1..d6e63d6e57ff913471a4b070311ac8937d4526fe 100644 (file)
@@ -2831,7 +2831,7 @@ dump_gimple_bb_header (FILE *outf, basic_block bb, int indent,
          if (bb->loop_father->header == bb)
            fprintf (outf, ",loop_header(%d)", bb->loop_father->num);
          if (bb->count.initialized_p ())
-           fprintf (outf, ",%s(%d)",
+           fprintf (outf, ",%s(%" PRIu64 ")",
                     profile_quality_as_string (bb->count.quality ()),
                     bb->count.value ());
          fprintf (outf, "):\n");
index f2b1e3a652525ae003209ab94c20f0bf20f00c21..c7a45ac5ee39a982818f0c5318771c182d6373ca 100644 (file)
@@ -804,7 +804,7 @@ public:
     }
 
   /* Get the value of the count.  */
-  uint32_t value () const { return m_val; }
+  uint64_t value () const { return m_val; }
 
   /* Get the quality of the count.  */
   enum profile_quality quality () const { return m_quality; }
index 28208477b6a25f4bd38ede74884aa8a57c2e3566..c8b0f7b33e129cb53c96680d830757cc454596a6 100644 (file)
@@ -8086,7 +8086,7 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags)
        {
          basic_block bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
          if (bb->count.initialized_p ())
-           fprintf (file, ",%s(%d)",
+           fprintf (file, ",%s(%" PRIu64 ")",
                     profile_quality_as_string (bb->count.quality ()),
                     bb->count.value ());
          fprintf (file, ")\n%s (", function_name (fun));