------- Additional Comments From steven at gcc dot gnu dot org 2005-07-27 19:21 ------- I'm not sure why reg-stack wants to insert compensation code at all. The reg-stack dump shows that st(0) is live-at-end in the source block of the edge, but not live-at-start for the target block: Analyzing compilation unitPerforming intraprocedural optimizations Assembling functions: foo Breakpoint 1, fancy_abort (file=0xb92af8 "../../mainline/gcc/reg-stack.c", line=2686, function=0xb93230 "compensate_edge") at diagnostic.c:590 590 internal_error ("in %s, at %s:%d", function, trim_filename (file), line); (gdb) up #1 0x000000000081098f in compensate_edge (e=0x2a95a6ef80, file=0xe3f6e0) at reg-stack.c:2686 2686 gcc_assert (! (e->flags & EDGE_ABNORMAL)); (gdb) p debug_bb (e->src) ;; basic block 12, loop depth 1, count 0 ;; prev block 11, next block 13 ;; pred: 11 [100.0%] (fallthru,dfs_back,can_fallthru) 7 [19.0%] (dfs_back,can_fallthru,irreducible) 6 [19.0%] (dfs_back,can_fallthru,irreducible) 3 [35.4%] (can_fallthru) ;; succ: 6 [25.0%] (ab,irreducible) 14 [25.0%] (ab,irreducible) 13 [25.0%] (ab,irreducible) 5 [25.0%] (ab,irreducible) ;; Registers live at start: 1 [dx] 3 [bx] 4 [si] 5 [di] 6 [bp] 7 [sp] 20 [frame] (code_label:HI 29 126 30 12 9 "" [3 uses]) (note:HI 30 29 125 12 [bb 12] NOTE_INSN_BASIC_BLOCK) (insn:TI 125 30 139 12 (set (reg:DF 8 st) (mem/i:DF (plus:SI (reg/f:SI 6 bp) (const_int -32 [0xffffffffffffffe0])) [4 absx+0 S8 A32])) 93 {*movdf_nointeger} (nil) (nil)) (insn:TI 139 125 31 12 (set (mem:DF (plus:SI (reg/f:SI 6 bp) (const_int -40 [0xffffffffffffffd8])) [11 S8 A8]) (reg:DF 8 st)) 93 {*movdf_nointeger} (insn_list:REG_DEP_TRUE 125 (nil)) (nil)) (jump_insn:TI 31 139 32 12 (set (pc) (reg/f:SI 1 dx [orig:59 gotovar.36 ] [59])) 525 {*indirect_jump} (insn_list:REG_DEP_ANTI 125 (insn_list:REG_DEP_TRUE 139 (nil))) (expr_list:REG_DEAD (reg/f:SI 1 dx [orig:59 gotovar.36 ] [59]) (nil))) ;; Registers live at end: 3 [bx] 4 [si] 5 [di] 6 [bp] 7 [sp] 8 [st] 20 [frame] $10 = void (gdb) p debug_bb (e->dest) ;; basic block 6, loop depth 1, count 0 ;; prev block 5, next block 7 ;; pred: 12 [25.0%] (ab,irreducible) 5 [100.0%] (fallthru,can_fallthru) 13 [50.0%] (can_fallthru,irreducible) 14 [50.0%] (can_fallthru,irreducible) 15 [100.0%] (can_fallthru,irreducible) ;; succ: 12 [19.0%] (dfs_back,can_fallthru,irreducible) 7 [81.0%] (fallthru,can_fallthru,irreducible) ;; Registers live at start: 3 [bx] 4 [si] 5 [di] 6 [bp] 7 [sp] 20 [frame] (code_label/s:HI 71 51 72 6 13 ("__label_000040") [6 uses]) (note:HI 72 71 118 6 [bb 6] NOTE_INSN_BASIC_BLOCK) (insn:TI 118 72 75 6 (set (reg/f:SI 1 dx [orig:59 gotovar.36 ] [59]) (label_ref:SI 49)) 40 {*movsi_1} (nil) (insn_list:REG_LABEL 49 (expr_list:REG_EQUAL (label_ref:SI 49) (nil)))) (insn:TI 75 118 76 6 (set (reg:CCZ 17 flags) (compare:CCZ (reg/f:SI 3 bx [orig:62 next.1 ] [62]) (reg:SI 1 dx))) 5 {*cmpsi_1_insn} (insn_list:REG_DEP_TRUE 118 (nil)) (nil)) (jump_insn:TI 76 75 78 6 (set (pc) (if_then_else (eq (reg:CCZ 17 flags) (const_int 0 [0x0])) (label_ref 29) (pc))) 509 {*jcc_1} (insn_list:REG_DEP_ANTI 118 (insn_list:REG_DEP_TRUE 75 (nil))) (expr_list:REG_DEAD (reg:CCZ 17 flags) (expr_list:REG_BR_PROB (const_int 1900 [0x76c]) (nil)))) ;; Registers live at end: 1 [dx] 3 [bx] 4 [si] 5 [di] 6 [bp] 7 [sp] 20 [frame] $11 = void (gdb)
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23095