From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24258 invoked by alias); 11 Oct 2005 03:20:46 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24237 invoked by uid 48); 11 Oct 2005 03:20:43 -0000 Date: Tue, 11 Oct 2005 03:20:00 -0000 Message-ID: <20051011032043.24236.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/24232] [4.1 Regression] ICE: segmentation fault in sched-ebb.c:220 add_missing_bbs In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "wilson at gcc dot gnu dot org" X-SW-Source: 2005-10/txt/msg01250.txt.bz2 List-Id: ------- Comment #8 from wilson at gcc dot gnu dot org 2005-10-11 03:20 ------- The patch in PR 23478 has no effect on this testcase. I tracked the origin of the problem for this testcase down to 2005-07-31 Jan Hubicka * tree-outof-ssa.c (coalesce_ssa_name): Use coalesce_cost. (coalesce_vars): Likewise. * tree-ssa-live.c (coalesce_cost): New. (build_tree_conflict_graph): Use coalesce_cost. * tree-ssa-live.h (coalesce_cost): Declare. But this patch did not cause the problem. It just exposed a latent problem. I noticed that the testcase works if I compile with -fno-reorder-blocks, however, I'm not sure if that is part of the problem, or just hiding the latent bug again. I am not very familiar with the sched_ebbs code, so this is taking some time. The insn stream does look funny in the middle of sched_ebb though, while scheduling a region contains basic blocks 1 through 3. Right before the fix_basic_block_boundaries call, we have ...insns from block 1... ...insns from block 2... branch for block 2 exit ...insns from block 1... branch for block 1 exit ...insns from block 2... ...insns from block 3... branch for block 3 exit Note that the branch that ends block 2 has been moved before the branch that ends block 1. Somehow I don't think that can be quite right. That confuses fix_basic_block_boundaries, which implicitly assumes that block exits will occur in numerical order. So after processing the block 2 branch exit, bb becomes block 3. Then when we process the block 1 branch exit, we have curr_bb as block 1, and curr_bb->prev_bb is block 0, so we call add_missing_bbs with block 3 as first and block 0 as last. The code then tries to scan backwards from block 0 to block 3 which of course does not work. I'm guessing a problem with instruction dependencies. In particular, it may be a problem with insn deps in the presense of COND_EXEC, as there is a COND_EXEC insn between the two branches. There was a patch in July that changed how this works. I'll look at this some more tomorrow. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24232