http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56242
vries at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 --- Comment #3 from vries at gcc dot gnu.org 2013-02-13 00:03:45 UTC --- I don't have an hp machine to reproduce this (I've asked for access to the gcc compile farm 2 weeks ago). I've tried to reproduce this bug by building a cross compiler using the hppa2.0w-unknown-linux-gnu target. I managed to build libjava, but I didn't manage to reproduce the bug. The thing I can see that's wrong is in NEXT_INSN (insn 11), which is note 152 but which should be note 153: ... (insn 428 427 153 (sequence [ (jump_insn:TI 151 427 11 (set (pc) (if_then_else (eq (reg:SI 28 %r28 [orig:123 D.12040+-2 ] [123]) (const_int 10 [0xa])) (label_ref:SI 165) (pc))) /test/gnu/gcc/gcc/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:162 28 {*pa.md:1439} (expr_list:REG_DEAD (reg:SI 28 %r28 [orig:123 D.12040+-2 ] [123]) (expr_list:REG_BR_PROB (const_int 2800 [0xaf0]) (nil))) -> 165) (insn 11 151 152 (set (reg:SI 7 %r7 [orig:129 D.12038 ] [129]) (reg:SI 5 %r5 [orig:132 ivtmp.903 ] [132])) 40 {*pa.md:2211} (nil)) ]) /test/gnu/gcc/gcc/libjava/classpath/gnu/javax/swing/text/html/parser/support/textPreProcessor.java:162 -1 (nil)) (note 153 428 152 [bb 19] NOTE_INSN_BASIC_BLOCK) (note 152 153 276 19 ("*L$Jpc=71164") NOTE_INSN_DELETED_LABEL 395) ... The code that deletes undeletable labels uses reorder_insns_nobb which is deprecated and doesn't know about SEQUENCEs: ... /* This function is deprecated, please use sequences instead. Move a consecutive bunch of insns to a different place in the chain. The insns to be moved are those between FROM and TO. They are moved to a new position after the insn AFTER. AFTER must not be FROM or TO or any insn in between. This function does not know about SEQUENCEs and hence should not be called after delay-slot filling has been done. */ void reorder_insns_nobb (rtx from, rtx to, rtx after) ... A fixup patch like this might work: ... Index: cfgrtl.c =================================================================== --- cfgrtl.c (revision 195874) +++ cfgrtl.c (working copy) @@ -119,6 +119,28 @@ can_delete_label_p (const_rtx label) && !in_expr_list_p (forced_labels, label)); } +static void +update_next_prev_in_sequence (const_rtx insn) +{ + rtx seq; + unsigned int length; + + if (insn == NULL_RTX + || !INSN_P (insn)) + return; + + seq = PATTERN (insn); + if (GET_CODE (PATTERN (seq)) != SEQUENCE) + return; + + length = XVECLEN (seq, 0); + if (length == 0) + return; + + PREV_INSN (XVECEXP (seq, 0, 0)) = PREV_INSN (insn); + NEXT_INSN (XVECEXP (seq, 0, length - 1)) = NEXT_INSN (insn); +} + /* Delete INSN by patching it out. */ void @@ -152,6 +174,8 @@ delete_insn (rtx insn) || label_bb == NULL)) { reorder_insns_nobb (insn, insn, bb_note); + update_next_prev_in_sequence (PREV_INSN (bb_note)); + update_next_prev_in_sequence (NEXT_INSN (insn)); bb = NOTE_BASIC_BLOCK (bb_note); BB_HEAD (bb) = bb_note; if (BB_END (bb) == bb_note) ...