I get the following on ia64, but not on e.g. x86_64. tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O2 erlang-beam_emu.c erlang-beam_emu.c: In function 'process_main': erlang-beam_emu.c:28: internal compiler error: in move_block_after_check, at haifa-sched.c:4337 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>. tbm@coconut0:~$ /usr/lib/gcc-snapshot/bin/gcc -c -O1 erlang-beam_emu.c tbm@coconut0:~$ gcc-4.1 -c -O2 erlang-beam_emu.c tbm@coconut0:~$ tbm@coconut0:~$ cat erlang-beam_emu.c typedef unsigned long Eterm; process_main (void) { register Eterm x0; register Eterm *reg = ((void *) 0); register Eterm *I = ((void *) 0); static void *opcodes[] = { &&lb_allocate_heap_zero_III, &&lb_allocate_init_tIy, &&lb_allocate_zero_tt }; lb_allocate_heap_III:{ Eterm *next; goto *(next); } lb_allocate_heap_zero_III:{ } lb_allocate_init_tIy:{ } lb_allocate_zero_tt:{ Eterm *next; { Eterm *tmp_ptr = ((Eterm *) (((x0)) - 0x1)); (*(Eterm *) (((unsigned char *) reg) + (I[(0) + 1]))) = ((tmp_ptr)[0]); x0 = ((tmp_ptr)[1]); } goto *(next); } }
Note that this code was affected by PR28489 and while the fix for this PR fixed the other testcases, this shows the current, new ICE.
And this is a regression because...?
Because of PR28489. Right.
This is where we ICE: Breakpoint 1, fancy_abort (file=0xbfb788 "../../trunk/gcc/haifa-sched.c", line=4337, function=0xbfc0a0 "move_block_after_check") at ../../trunk/gcc/diagnostic.c:642 642 internal_error ("in %s, at %s:%d", function, trim_filename (file), line); (gdb) up #1 0x0000000000a721d5 in move_block_after_check (jump=0x2aaaaaf8f180) at ../../trunk/gcc/haifa-sched.c:4336 4336 gcc_assert (RECOVERY_BLOCK (jump) (gdb) l 4331 jump_bb = BLOCK_FOR_INSN (jump); 4332 jump_bb_next = jump_bb->next_bb; 4333 4334 update_bb_for_insn (jump_bb); 4335 4336 gcc_assert (RECOVERY_BLOCK (jump) 4337 || RECOVERY_BLOCK (BB_END (jump_bb_next))); 4338 4339 unlink_block (jump_bb_next); 4340 link_block (jump_bb_next, bb); (gdb) p debug_rtx(jump) (jump_insn 93 121 122 7 (set (pc) (reg:DI 326 b6)) 330 {indirect_jump} (nil) (expr_list:REG_DEAD (reg:DI 326 b6) (nil))) $7 = void (gdb) p h_i_d[93].recovery_block $8 = (basic_block) 0x0 (gdb) p debug_bb(jump_bb_next) ;; basic block 8, loop depth 0, count 0 ;; prev block 7, next block 1 ;; pred: ;; succ: ;; Registers live at start: (nil) (note 122 93 94 8 [bb 8] NOTE_INSN_BASIC_BLOCK) (note 94 122 96 7 [bb 7] NOTE_INSN_BASIC_BLOCK) ;; Registers live at end: (nil) $9 = void (gdb)
Created attachment 12315 [details] Patch. That's my bug, sorry. The attached patch has only been tested on x86_64; sadly, I'll be able to run it on ia64 not before Monday. 2006-09-23 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> PR rtl-optimization/29128 * sched-ebb.c (advance_target_bb): Use correct condition to allow interblock movement of speculation checks. * sched-int.h (IS_SPEC_BRANCY_CHECK_P): New macro. 2006-09-23 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> PR rtl-optimization/29128 * gcc.c-torture/compile/pr29128.c: New test.
Subject: Bug 29128 Author: mkuvyrkov Date: Fri Oct 6 21:45:13 2006 New Revision: 117515 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117515 Log: 2006-10-06 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> PR rtl-optimization/29128 * sched-int.h (IS_SPECULATION_BRANCHY_CHECK_P): New macro. * sched-ebb.c (advance_target_bb): Use it to fix condition to allow interblock movement of speculation checks. * gcc.c-torture/compile/pr29128.c: New test. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr29128.c Modified: trunk/gcc/ChangeLog trunk/gcc/sched-ebb.c trunk/gcc/sched-int.h trunk/gcc/testsuite/ChangeLog
Fixed by the above patch.