[patches] Re: infinite loop in SPEC's gcc after your patches
Richard Henderson
rth@redhat.com
Mon Jul 23 14:11:00 GMT 2001
On Mon, Jul 23, 2001 at 10:57:48PM +0200, Jan Hubicka wrote:
> All the can_fallthrdu does as extra compared to the index test above is
> to verify, that there is no jump table lurking around.
Oh, right. I keep reading that as a check that there's
no jump insn as well. Which of course there would be.
> ! if (cbranch_block->end != PREV_INSN (cbranch_dest_block->head))
> ! flow_delete_insn_chain (NEXT_INSN (cbranch_block->end),
> ! PREV_INSN (cbranch_dest_block->head));
Better. Actually, would you check and see if this works
on your test case? I was about to start bootstrapping it
here, but as I never saw the original problem on alpha...
r~
* flow.c (try_simplify_condjump): Use tidy_fallthru_edge.
Index: flow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/flow.c,v
retrieving revision 1.436
diff -c -p -d -u -r1.436 flow.c
--- flow.c 2001/07/23 15:27:33 1.436
+++ flow.c 2001/07/23 21:09:16
@@ -3073,17 +3073,18 @@ try_simplify_condjump (cbranch_block)
fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n",
INSN_UID (cbranch_insn), INSN_UID (jump_block->end));
- /* Success. Update the CFG to match. */
+ /* Success. Update the CFG to match. Note that after this point
+ the edge variable names appear backwards; the redirection is done
+ this way to preserve edge profile data. */
redirect_edge_succ (cbranch_jump_edge, cbranch_dest_block);
redirect_edge_succ (cbranch_fallthru_edge, jump_dest_block);
cbranch_jump_edge->flags |= EDGE_FALLTHRU;
cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU;
+ /* Delete the block with the unconditional jump, and clean up the mess. */
flow_delete_block (jump_block);
- /* Selectively unlink the sequence. */
- if (cbranch_jump_edge->src->end != PREV_INSN (cbranch_jump_edge->dest->head))
- flow_delete_insn_chain (NEXT_INSN (cbranch_jump_edge->src->end),
- PREV_INSN (cbranch_jump_edge->dest->head));
+ tidy_fallthru_edge (cbranch_jump_edge, cbranch_block, cbranch_dest_block);
+
return true;
}
More information about the Gcc-patches
mailing list