public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3580] cgraph: Do not warn about caller count mismatches of removed functions
@ 2021-09-16 15:08 Martin Jambor
  0 siblings, 0 replies; only message in thread
From: Martin Jambor @ 2021-09-16 15:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:371848a7ed301ee4d6e33842ba41e79412c5d0b0

commit r12-3580-g371848a7ed301ee4d6e33842ba41e79412c5d0b0
Author: Martin Jambor <mjambor@suse.cz>
Date:   Thu Sep 16 14:04:06 2021 +0200

    cgraph: Do not warn about caller count mismatches of removed functions
    
    To verify other changes in the patch series, I have been searching for
    "Invalid sum of caller counts" string in symtab dump but found that
    there are false warnings about functions which have their body removed
    because they are now unreachable.  Those are of course invalid and so
    this patches avoids checking such cgraph_nodes.
    
    gcc/ChangeLog:
    
    2021-08-20  Martin Jambor  <mjambor@suse.cz>
    
            * cgraph.c (cgraph_node::dump): Do not check caller count sums if
            the body has been removed.  Remove trailing whitespace.

Diff:
---
 gcc/cgraph.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 8f3af003f2a..de078653781 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2236,7 +2236,7 @@ cgraph_node::dump (FILE *f)
     }
   fprintf (f, "\n");
 
-  if (count.ipa ().initialized_p ())
+  if (!body_removed && count.ipa ().initialized_p ())
     {
       bool ok = true;
       bool min = false;
@@ -2245,7 +2245,7 @@ cgraph_node::dump (FILE *f)
       FOR_EACH_ALIAS (this, ref)
 	if (dyn_cast <cgraph_node *> (ref->referring)->count.initialized_p ())
 	  sum += dyn_cast <cgraph_node *> (ref->referring)->count.ipa ();
-  
+
       if (inlined_to
 	  || (symtab->state < EXPANSION
 	      && ultimate_alias_target () == this && only_called_directly_p ()))


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-16 15:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 15:08 [gcc r12-3580] cgraph: Do not warn about caller count mismatches of removed functions 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).