public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2328] Change the type of return value of profile_count::value to uint64_t
@ 2021-07-15 15:27 Martin Jambor
0 siblings, 0 replies; only message in thread
From: Martin Jambor @ 2021-07-15 15:27 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:07bd2703047d222ed7ff189d86350e73c5cc2c9e
commit r12-2328-g07bd2703047d222ed7ff189d86350e73c5cc2c9e
Author: Martin Jambor <mjambor@suse.cz>
Date: Thu Jul 15 17:26:45 2021 +0200
Change the type of return value of profile_count::value to uint64_t
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.
Diff:
---
gcc/gimple-pretty-print.c | 2 +-
gcc/profile-count.h | 2 +-
gcc/tree-cfg.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index 39c5775e2cb..d6e63d6e57f 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -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");
diff --git a/gcc/profile-count.h b/gcc/profile-count.h
index f2b1e3a6525..c7a45ac5ee3 100644
--- a/gcc/profile-count.h
+++ b/gcc/profile-count.h
@@ -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; }
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 28208477b6a..c8b0f7b33e1 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -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));
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-15 15:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 15:27 [gcc r12-2328] Change the type of return value of profile_count::value to uint64_t Martin Jambor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).