[Bug rtl-optimization/16014] [3.5 Regression] ICE in label_for_bb at cfglayout.c:175
joern dot rennecke at superh dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 16 11:39:00 GMT 2004
------- Additional Comments From joern dot rennecke at superh dot com 2004-06-16 11:39 -------
Subject: Re: [3.5 Regression] ICE in label_for_bb at cfglayout.c:175
>
>
> ------- Additional Comments From belyshev at lubercy dot com 2004-06-16 09:42 -------
> small testcase, use '-O2':
> -------------------------------------------------------------------------------
> struct tree_node
> {
> unsigned long low;
> long high;
> };
>
> int
> host_integerp (struct tree_node *t, int pos, int code)
> {
> return (code == 1
> && (((t)->high == 0
> && (long)((t)->low) >= 0)
> || (!pos && ((t)->high) == -1)
> || (pos && ((t)->high) == 0))
> );
> }
> -------------------------------------------------------------------------------
> Program received signal SIGSEGV, Segmentation fault.
> label_for_bb (bb=0x40530934) at ../../gcc/gcc/cfglayout.c:175
> 175 if (GET_CODE (label) != CODE_LABEL)
> (gdb) where
> #0 label_for_bb (bb=0x40530934) at ../../gcc/gcc/cfglayout.c:175
> #1 0x0815c904 in fixup_reorder_chain () at ../../gcc/gcc/cfglayout.c:712
> #2 0x0815d4fb in cfg_layout_finalize () at ../../gcc/gcc/cfglayout.c:1213
> #3 0x0834ae25 in reorder_basic_blocks () at ../../gcc/gcc/bb-reorder.c:1962
> #4 0x0832b0ef in rest_of_handle_reorder_blocks (decl=0x405261f0, insns=0x40458630)
> at ../../gcc/gcc/passes.c:754
> #5 0x0832d03f in rest_of_compilation () at ../../gcc/gcc/passes.c:1882
> #6 0x080ce092 in execute_one_pass (pass=0x8553e80) at
> ../../gcc/gcc/tree-optimize.c:421
> #7 0x080ce101 in execute_pass_list (pass=0x8553e80) at
> ../../gcc/gcc/tree-optimize.c:446
> #8 0x080ce2d1 in tree_rest_of_compilation (fndecl=0x405261f0, nested_p=0 '\0')
> at ../../gcc/gcc/tree-optimize.c:523
> #9 0x080653bb in c_expand_body (fndecl=0x405261f0) at ../../gcc/gcc/c-decl.c:6335
> #10 0x08346895 in cgraph_expand_function (node=0x4052683c) at
> ../../gcc/gcc/cgraphunit.c:794
> #11 0x08348203 in cgraph_expand_all_functions () at ../../gcc/gcc/cgraphunit.c:1668
> #12 0x083484e5 in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1758
> #13 0x080a219c in c_objc_common_finish_file () at ../../gcc/gcc/c-objc-common.c:230
> #14 0x08051e27 in finish_file () at ../../gcc/gcc/c-lang.c:210
> #15 0x0809a07a in c_common_parse_file (set_yydebug=0) at ../../gcc/gcc/c-opts.c:1241
> #16 0x082fbefe in compile_file () at ../../gcc/gcc/toplev.c:960
> #17 0x082fd68e in do_compile () at ../../gcc/gcc/toplev.c:2022
> #18 0x082fd6ec in toplev_main (argc=0, argv=0xbffff934) at
> ../../gcc/gcc/toplev.c:2054
> #19 0x080b0844 in main (argc=0, argv=0x0) at ../../gcc/gcc/main.c:35
I currently don't have a powerpc compiler at hand (I'm bulding one now);
does this patch help?
2004-06-16 J"orn Rennecke <joern.rennecke@superh.com>
* cfglayout.c (fixup_reorder_chain): Handle case where the
destination of E_FALL is EXIT_BLOCK_PTR.
Index: cfglayout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfglayout.c,v
retrieving revision 1.61
diff -p -r1.61 cfglayout.c
*** cfglayout.c 15 Jun 2004 11:58:40 -0000 1.61
--- cfglayout.c 16 Jun 2004 11:36:31 -0000
*************** fixup_reorder_chain (void)
*** 712,718 ****
if (note
&& INTVAL (XEXP (note, 0)) < REG_BR_PROB_BASE / 2
&& invert_jump (bb_end_insn,
! label_for_bb (e_fall->dest), 0))
{
#ifdef ENABLE_CHECKING
if (!could_fall_through (e_taken->src, e_taken->dest))
--- 712,720 ----
if (note
&& INTVAL (XEXP (note, 0)) < REG_BR_PROB_BASE / 2
&& invert_jump (bb_end_insn,
! (e_fall->dest
! ? label_for_bb (e_fall->dest)
! : NULL_RTX), 0))
{
#ifdef ENABLE_CHECKING
if (!could_fall_through (e_taken->src, e_taken->dest))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16014
More information about the Gcc-bugs
mailing list