public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/35452]  New: erasing uncessary warning for basic block frequency computation
@ 2008-03-04  3:34 zhouyi04 at ios dot cn
  2008-03-05  7:03 ` [Bug tree-optimization/35452] " zhouyi04 at ios dot cn
  2009-04-18 20:01 ` steven at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: zhouyi04 at ios dot cn @ 2008-03-04  3:34 UTC (permalink / raw)
  To: gcc-bugs

When compiling program like following:
int
fn(int s) {
  int i;

  i = 2;

  if (s)
   i = 1;

  if (s)
   printf("%d\n", i);


  return 0;
}

#cc1 -O2 -fdump-tree-vrp-all hello.c
There will be:
Jumps threaded: 1
Removing basic block 3
;; basic block 3, loop depth 0, count 0
;; prev block 7, next block 4
;; pred:
;; succ:       4 [100.0%]  (fallthru,exec)
Invalid sum of incoming frequencies 0, should be 5000
<L0>:;
in hello.c.055t.vrp1 etc.


A patch:
--- gcc/gcc/tree-cfgcleanup.c~  Sat Jan  5 14:45:30 2008
+++ gcc/gcc/tree-cfgcleanup.c   Tue Mar  4 11:11:49 2008
@@ -427,6 +427,9 @@
       else
        s = redirect_edge_and_branch (e, dest);

+      bb->frequency -= EDGE_FREQUENCY(e);
+      bb->count -= e->count;
+
       if (s == e)
        {
          /* Create arguments for the phi nodes, since the edge was not


Anyone help me to regression test it, because I am not able to 
regression it in current juncture :-)


-- 
           Summary: erasing uncessary warning for basic block frequency
                    computation
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zhouyi04 at ios dot cn
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35452


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-18 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04  3:34 [Bug tree-optimization/35452] New: erasing uncessary warning for basic block frequency computation zhouyi04 at ios dot cn
2008-03-05  7:03 ` [Bug tree-optimization/35452] " zhouyi04 at ios dot cn
2009-04-18 20:01 ` steven at gcc dot gnu dot org

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).