This patch fixes a disagreement about the form of REG_BR_PRED. I came across it as an rtl-checking ICE when inverting a jump after dbr_schedule.
REG_BR_PRED used to be just a single int (and is still documented that way, although I'm going to chicken out of fixing that). dbr_schedule created the notes at the end, so that targets could tell whether the branch was assumed to be likely-taken or not. However, no target now uses this information, and all other references to the notes are for the new 2-int style. This patch therefore removes the old code as dead. Tested on mips64-linux-gnu and applied. Richard gcc/ * reorg.c (dbr_schedule): Delete REG_BR_PRED loop. Index: gcc/reorg.c =================================================================== --- gcc/reorg.c 2012-08-02 21:19:07.320527035 +0100 +++ gcc/reorg.c 2012-08-02 21:21:53.698526627 +0100 @@ -4054,28 +4054,6 @@ dbr_schedule (rtx first) fprintf (dump_file, "\n"); } - /* For all JUMP insns, fill in branch prediction notes, so that during - assembler output a target can set branch prediction bits in the code. - We have to do this now, as up until this point the destinations of - JUMPS can be moved around and changed, but past right here that cannot - happen. */ - for (insn = first; insn; insn = NEXT_INSN (insn)) - { - int pred_flags; - - if (NONJUMP_INSN_P (insn)) - { - rtx pat = PATTERN (insn); - - if (GET_CODE (pat) == SEQUENCE) - insn = XVECEXP (pat, 0, 0); - } - if (!JUMP_P (insn)) - continue; - - pred_flags = get_jump_flags (insn, JUMP_LABEL (insn)); - add_reg_note (insn, REG_BR_PRED, GEN_INT (pred_flags)); - } free_resource_info (); free (uid_to_ruid); #ifdef DELAY_SLOTS_FOR_EPILOGUE