Message ID | 5285CB27.50503@redhat.com |
---|---|
State | New |
Headers | show |
> But that makes *no* sense when the trap is in the else block. The label > has been deleted from the insn chain and more importantly, we want to > fallthru if we do not trap! > > Thankfully the the CFG checking code detected this inconsistency. It's > been latent since 2002! Clearly we aren't doing a lot of optimizing > conditional jumps over/to traps into conditional traps! Not clear IMO, this seems to have been broken by r120686. > Anyway, the fix is trivial. When trap_bb == then_bb, run the code as > is. When trap_bb == else_bb we only want to remove the conditinoal jump > as we want to fallthru if the conditional trap doesn't trigger. > > With this patch applied and Kirill's patch removed, I can almost > bootstrap the ia64 port with Ada enabled (comparison failure that AFAICT > is not related to the isolate-erroneous-paths optimization) > > > > OK for the trunk if it passes a bootstrap & regtest on x86_64 overnight? Yes, this looks fine to me.
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index fafff9d..17d26c5 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -3694,7 +3694,7 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge) /* Wire together the blocks again. */ if (current_ir_type () == IR_RTL_CFGLAYOUT) single_succ_edge (test_bb)->flags |= EDGE_FALLTHRU; - else + else if (trap_bb == then_bb) { rtx lab, newjump;