------- Comment #5 from ubizjak at gmail dot com 2009-08-01 22:25 ------- The backtrace:
#0 fancy_abort (file=0xc59e30 "../../gcc-svn/trunk/gcc/reg-stack.c", line=741, function=0xc5a5f0 "get_hard_regnum") at ../../gcc-svn/trunk/gcc/diagnostic.c:729 #1 0x0000000000708a5e in get_hard_regnum (regstack=<value optimized out>, reg=<value optimized out>) at ../../gcc-svn/trunk/gcc/reg-stack.c:741 #2 0x000000000070b6cd in subst_stack_regs_pat (insn=0x7ffff28ba960, regstack=0x7fffffffddd0, pat=<value optimized out>) at ../../gcc-svn/trunk/gcc/reg-stack.c:1889 #3 0x000000000070c703 in subst_stack_regs (insn=0x7ffff28ba960, regstack=0x7fffffffddd0) at ../../gcc-svn/trunk/gcc/reg-stack.c:2319 We call get_hard_regnum() with: (gdb) p debug_rtx (*dest) (pc) that register comes as a target from insn: (jump_insn:TI 52 50 56 11 test.c:32 (parallel [ (set (pc) (if_then_else (le (reg/v:SF 9 st(1) [orig:64 move ] [64]) (reg:SF 8 st [80])) (label_ref:SI 60) (pc))) (clobber (reg:CCFP 18 fpsr)) (clobber (reg:CCFP 17 flags)) (clobber (reg:HI 0 ax)) ]) 626 {*fp_jcc_3_387} (expr_list:REG_DEAD (reg/v:SF 9 st(1) [orig:64 move ] [64]) So, this part of reg-stack.c is kind of wrong: /* If the comparison operator is an FP comparison operator, it is handled correctly by compare_for_stack_reg () who will move the destination to the top of stack. But if the comparison operator is not an FP comparison operator, we have to handle it here. */ if (get_hard_regnum (regstack, *dest) >= FIRST_STACK_REG && REGNO (*dest) != regstack->reg[regstack->top]) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40934