make CFG survive post-reload splitting: SH breakage

Andrew Haley aph@cambridge.redhat.com
Mon Jul 23 11:34:00 GMT 2001


I've got a problem that I think may be related to a patch of yours.

On the SH, after we do delayed branch reorg we have a basic block that
ends like this:

(insn 91 87 92 (sequence[ 
            (jump_insn 85 87 83 (return) 117 {*return_i} (nil)
                (expr_list:REG_BR_PRED (const_int 12 [0xc])
                    (nil)))
            (insn 83 85 92 (set (reg:SI 8 r8)
                    (mem:SI (post_inc:SI (reg/f:SI 15 r15)) 0)) 81 {movsi_i} (insn_list 82 (nil))
                (expr_list:REG_INC (reg/f:SI 15 r15)
                    (nil)))
        ] ) -1 (nil)
    (nil))

split_all_insns() runs through a basic block looking for bb->end,
which in this case is insn 85.  It never finds it because insn 85 has
been buried inside the sequence that is insn 91.  The compiler aborts.

This didn't used to matter because split_all_insns() didn't care about
basic block info at this point in the compilation.  Your patch changed
all that, and now we do care about basic block information:

Tue Jul 17 17:10:14 CEST 2001  Jan Hubicka  <jh@suse.cz.
        * recog.c (split_all_insns): Always expect CFG to be consistent;
        call find_sub_basic_blocks in case something has changed.
        * toplev.c (rest_of_compilation): Always call split_all_insns once CFG
        has been built.

I'm not sure what might be the best way to fix this.  Does
split_all_insns() need to be recoded so that it looks inside
sequences, perhaps?  Perhaps reorg should point bb->end at the
sequence instead?

Andrew.



More information about the Gcc-bugs mailing list