From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2312 invoked by alias); 4 Mar 2008 03:34:00 -0000 Received: (qmail 2226 invoked by uid 48); 4 Mar 2008 03:33:18 -0000 Date: Tue, 04 Mar 2008 03:34:00 -0000 Subject: [Bug tree-optimization/35452] New: erasing uncessary warning for basic block frequency computation X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "zhouyi04 at ios dot cn" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00205.txt.bz2 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 :; 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