This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

redirect_edge_and_branch sanity check


Working on a new port, I discovered that I had forgotten to update
one of the cpu.c functions to match a change to tighten the
compare-and-branch predicates.  This resulted in the initial rtl
containing an unrecognizable jump insn.

Which resulted in redirect_jump failing, which we ignored, proceeded
to delete a label that is (unbenownst to us) still used, which makes
us die in a very confusing way much much later.


r~


        * cfgrtl.c (redirect_edge_and_branch): Abort if redirect_jump fails.

Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.1
diff -c -p -d -r1.1 cfgrtl.c
*** cfgrtl.c	2001/09/25 15:26:50	1.1
--- cfgrtl.c	2001/09/29 00:17:31
*************** redirect_edge_and_branch (e, target)
*** 860,866 ****
        /* If the insn doesn't go where we think, we're confused.  */
        if (JUMP_LABEL (insn) != old_label)
  	abort ();
!       redirect_jump (insn, block_label (target), 0);
      }
  
    if (rtl_dump_file)
--- 860,869 ----
        /* If the insn doesn't go where we think, we're confused.  */
        if (JUMP_LABEL (insn) != old_label)
  	abort ();
!       /* If the substitution doesn't succeed, die.  This can happen
! 	 if the back end emitted unrecognizable instructions.  */
!       if (! redirect_jump (insn, block_label (target), 0))
! 	abort ();
      }
  
    if (rtl_dump_file)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]