From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19435 invoked by alias); 5 Dec 2011 14:51:48 -0000 Received: (qmail 19421 invoked by uid 22791); 5 Dec 2011 14:51:46 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CF X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Dec 2011 14:51:32 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/48641] [4.7 Regression] ICE: verify_flow_info failed: Wrong frequency of block 77 -419530 with -O -fno-tree-ccp -fno-tree-copy-prop Date: Mon, 05 Dec 2011 14:51:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Attachment #24012 is obsolete Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-12/txt/msg00415.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48641 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24012|0 |1 is obsolete| | --- Comment #2 from Jakub Jelinek 2011-12-05 14:51:12 UTC --- Created attachment 25991 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25991 pr48641.c Slightly more reduced testcase. The problem is in the thread-ssa-threadupdate.c (redirect_edges) hunk added in r102053: rd->dup_block->count += e->count; rd->dup_block->frequency += EDGE_FREQUENCY (e); EDGE_SUCC (rd->dup_block, 0)->count += e->count; create_duplicates on this testcase creates huge number of basic blocks, and this function adjusts the edges, so that each of these rd->dup_block has two incoming edges, one 100% EDGE_FREQUENCY (for the first one of these from the ENTRY successor, another one from some other bb (which will be removed as dead later on, for the other blocks one of the predecessors is the previous dup block). Unfortunately this means that rd->dup_block->frequency goes over BB_FREQ_MAX (the first of these has BB_FREQ_MAX + something, second that plus something2, etc.) and finally the EDGE_FREQUENCY computation overflows (e->src->frequency where e->src is the previous rd->dup_block is over 214748 and EDGE_FREQUENCY multiplies that by 10000). Caping it to BB_FREQ_MAX wouldn't probably work, because then cfg cleanup that removes all the unreachable blocks would decrease it too much. Honza?