This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Two cfg related fixes
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 9 May 2002 14:15:47 +0200
- Subject: Two cfg related fixes
Hi,
I've bootstrapped and regtested the attached simple fixes and I am going
to install them as obvious.
Thu May 9 14:12:35 CEST 2002 Jan Hubicka <jh@suse.cz>
* cfganal.c (can_fallthru): Fix fast path.
* cfgrtl.c (verify_flow_info): Avoid crash on conditionals
with edges to the next block.
Index: cfganal.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfganal.c,v
retrieving revision 1.6.2.10
diff -c -3 -p -r1.6.2.10 cfganal.c
*** cfganal.c 13 Mar 2002 20:25:49 -0000 1.6.2.10
--- cfganal.c 9 May 2002 12:09:52 -0000
*************** can_fallthru (src, target)
*** 87,93 ****
rtx insn = src->end;
rtx insn2 = target->head;
! if (src->index + 1 == target->index && !active_insn_p (insn2))
insn2 = next_active_insn (insn2);
/* ??? Later we may add code to move jump tables offline. */
--- 87,96 ----
rtx insn = src->end;
rtx insn2 = target->head;
! if (src->index + 1 != target->index)
! return 0;
!
! if (!active_insn_p (insn2))
insn2 = next_active_insn (insn2);
/* ??? Later we may add code to move jump tables offline. */
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.10.2.37
diff -c -3 -p -r1.10.2.37 cfgrtl.c
*** cfgrtl.c 1 May 2002 20:45:10 -0000 1.10.2.37
--- cfgrtl.c 9 May 2002 12:09:55 -0000
*************** verify_flow_info ()
*** 1785,1790 ****
--- 1785,1791 ----
if (INSN_P (bb->end)
&& (note = find_reg_note (bb->end, REG_BR_PROB, NULL_RTX))
+ && bb->succ && bb->succ->succ_next
&& any_condjump_p (bb->end))
{
if (INTVAL (XEXP (note, 0)) != BRANCH_EDGE (bb)->probability)