This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/35452] New: erasing uncessary warning for basic block frequency computation


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]