[Bug rtl-optimization/48156] [4.6/4.7 Regression] wrong code with -fcrossjumping
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 18 12:46:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48156
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bernds at gcc dot gnu.org,
| |bonzini at gnu dot org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-18 12:42:33 UTC ---
The problem is that try_head_merge_bb uses DF info that isn't up to date after
previous crossjumping and hasn't been updated yet.
In particular when we compute live_union, one merge_bb is:
;; basic block 4, loop depth 0, count 0
;; prev block 3, next block 5
;; pred: 3 [20.7%] (fallthru)
;; succ: 7 [100.0%]
;; bb 4 artificial_defs: { }
;; bb 4 artificial_uses: { u-1(7){ }}
;; lr in 3 [bx] 7 [sp]
;; lr use 3 [bx] 7 [sp]
;; lr def 0 [ax] 1 [dx] 2 [cx] 4 [si] 5 [di] 8 [st] 9 [st(1)] 10 [st(2)]
11 [st(3)] 12 [st(4)] 13 [st(5)] 14 [st(6)] 15 [st(7)] 17 [flags] 18 [fpsr] 19
[fpcr] 21 [xmm0] 22 [xmm1] 23 [xmm2] 24 [xmm3] 25 [xmm4] 26 [xmm5] 27 [xmm6] 28
[xmm7] 29 [mm0] 30 [mm1] 31 [mm2] 32 [mm3] 33 [mm4] 34 [mm5] 35 [mm6] 36 [mm7]
37 [r8] 38 [r9] 39 [r10] 40 [r11] 45 [xmm8] 46 [xmm9] 47 [xmm10] 48 [xmm11] 49
[xmm12] 50 [xmm13] 51 [xmm14] 52 [xmm15]
(note 24 23 25 4 [bb 4] NOTE_INSN_BASIC_BLOCK)
(insn 25 24 26 4 (set (reg:SI 4 si)
(reg/v:SI 3 bx [orig:59 i ] [59])) pr48156.c:31 64 {*movsi_internal}
(expr_list:REG_DEAD (reg/v:SI 3 bx [orig:59 i ] [59])
(nil)))
(insn 26 25 62 4 (set (reg:SI 5 di)
(const_int 8 [0x8])) pr48156.c:31 64 {*movsi_internal}
(nil))
(jump_insn 62 26 63 4 (set (pc)
(label_ref 61)) -1
(nil)
-> 61)
;; lr out 7 [sp]
where lr_out is obviously wrong, lr out should also include 4 [si] 5 [di].
That lr_out comes from the bb that originally also included the call to baz
which consumed and made dead those two registers. The other merge_bb has
exactly the same problem. bb 7 (the new bb which contains just the call to
baz)
has lr in/use/def/out all empty.
So I guess we need to tell DF to recompute it after each successful
crossjumping or recompute it somehow manually.
More information about the Gcc-bugs
mailing list