This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/24232] [4.1 Regression] ICE: segmentation fault in sched-ebb.c:220 add_missing_bbs
- From: "wilson at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2005 03:20:43 -0000
- Subject: [Bug target/24232] [4.1 Regression] ICE: segmentation fault in sched-ebb.c:220 add_missing_bbs
- References: <bug-24232-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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 <jh@suse.cz>
* 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