Richard Biener wrote:
> On Mon, Dec 8, 2014 at 10:49 PM, Steve Ellcey <sell...@mips.com> wrote:
> > expected?  Should this test also check flag_thread_jumps?  Or should
> > that be getting checked somewhere else?
> 
> -fthread-jumps is an RTL optimization flag and ignored on GIMPLE.

Does it make sense to add a -f[no-]tree-thread-jumps to enable/disable the tree
jump threading?  I could also add -f[no-]tree-fsm-thread-jumps.  Opinions?

On the llvm test-suite, I have seen one ICE with my fsm jump-thread patch.
This patch fixes the problem:

diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 12f83ba..f8c736e 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -2564,6 +2564,7 @@ thread_through_all_blocks (bool may_peel_loop_headers)
   FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
     {
       if (!loop->header
+        || !loop_latch_edge (loop)
           || !bitmap_bit_p (threaded_blocks, loop->header->index))
           continue;
 
      retval |= thread_through_loop_header (loop, may_peel_loop_headers);

Ok to commit after regstrap?

Thanks,
Sebastian

Reply via email to