gcc.c-torture/execute/built-in-setjmp.c fails at -O2 with the ICE: built-in-setjmp.c:39: error: call edges for non-call insn in bb 6 built-in-setjmp.c:39: error: in basic block 6: built-in-setjmp.c:39: error: flow control insn inside a basic block (call_insn/u:HI 58 147 172 6 (parallel [ (set (reg:SI 2 r2) (call (mem:DI (reg/f:SI 128 tr0 [188]) [0 S8 A64]) (const_int 0 [0x0]))) (clobber (reg:DI 18 r18)) ]) 236 {call_value_media} (nil) (expr_list:REG_DEAD (reg:SI 3 r3) (expr_list:REG_DEAD (reg/f:SI 128 tr0 [188]) (expr_list:REG_UNUSED (reg:DI 18 r18) (expr_list:REG_EH_REGION (const_int 0 [0x0]) (nil))))) (expr_list:REG_DEP_TRUE (use (mem:BLK (scratch) [0 A8])) (expr_list:REG_DEP_TRUE (use (reg:SI 3 r3)) (expr_list:REG_DEP_TRUE (use (reg:SI 2 r2 [ p ])) (nil))))) built-in-setjmp.c:39: internal compiler error: in rtl_verify_flow_info_1, at cfgrtl.c:2040
on sh64-unknown-linux-elf target. It doesn't occur on sh64-elf target which uses the sjlj exceptions. It seems that bt-load.c: migrate_btr_def() moves the insn which sets the target register to just after the call insn which was the last insn of a BB having abnormal edges and the assersion in rtl_verify_flow_info_1 fails. I'm testing the patch below now. --- ORIG/trunk/gcc/bt-load.c Wed Mar 15 21:20:37 2006 +++ LOCAL/trunk/gcc/bt-load.c Mon May 1 08:51:18 2006 @@ -1339,6 +1339,15 @@ migrate_btr_def (btr_def def, int min_co /* Try to move the instruction that sets the target register into basic block TRY. */ int try_freq = basic_block_freq (try); + edge_iterator ei; + edge e; + + /* If TRY has abnormal edges, skip it. */ + FOR_EACH_EDGE (e, ei, try->succs) + if (e->flags & EDGE_COMPLEX) + break; + if (e) + continue; if (dump_file) fprintf (dump_file, "trying block %d ...", try->index); -- Summary: gcc.c-torture/execute/built-in-setjmp.c fails on sh64-*- linux-gnu with -O2 Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kkojima at gcc dot gnu dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: sh64-*-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27406