diff options
author | Tom de Vries <tdevries@suse.de> | 2018-07-16 09:18:51 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2018-07-16 09:18:51 +0000 |
commit | 8c0e07e3842dd90c09fd3f4b5fe17362c5ab4077 (patch) | |
tree | c623200c666ebbf79d9e42f357704c66ba1bf055 /libssp | |
parent | 1d896f48fa2f796ba13773ab735ef40fa3afb257 (diff) | |
download | gcc-8c0e07e3842dd90c09fd3f4b5fe17362c5ab4077.zip gcc-8c0e07e3842dd90c09fd3f4b5fe17362c5ab4077.tar.gz gcc-8c0e07e3842dd90c09fd3f4b5fe17362c5ab4077.tar.bz2 |
[debug] Fix pre_dec handling in vartrack
When compiling test-case gcc.target/i386/vartrack-1.c with -O1 -g, register bx
is pushed in the prologue and popped in the epilogue:
...
(insn/f 26 3 27 2
(set (mem:DI (pre_dec:DI (reg/f:DI 7 sp)) [0 S8 A8])
(reg:DI 3 bx))
"vartrack-1.c":10 61 {*pushdi2_rex64}
(expr_list:REG_DEAD (reg:DI 3 bx) (nil)))
...
(insn/f 29 28 30 2
(set (reg:DI 3 bx)
(mem:DI (post_inc:DI (reg/f:DI 7 sp)) [0 S8 A8]))
"vartrack-1.c":15 71 {*popdi1}
(expr_list:REG_CFA_ADJUST_CFA
(set (reg/f:DI 7 sp)
(plus:DI (reg/f:DI 7 sp)
(const_int 8 [0x8]))) (nil)))
...
However, when we adjust those insns in vartrack to eliminate the pre_dec and
post_inc, the frame location for the push is at argp - 24, while the one for the
pop is at argp - 16:
...
(insn/f 26 3 27 2
(parallel [
(set (mem:DI (plus:DI (reg/f:DI 16 argp)
(const_int -24 [0xffffffffffffffe8])) [0 S8 A8])
(reg:DI 3 bx))
(set (reg/f:DI 7 sp)
(plus:DI (reg/f:DI 16 argp)
(const_int -24 [0xffffffffffffffe8])))
])
"vartrack-1.c":10 61 {*pushdi2_rex64}
(expr_list:REG_DEAD (reg:DI 3 bx) (nil)))
...
(insn/f 29 28 30 2
(parallel [
(set (reg:DI 3 bx)
(mem:DI (plus:DI (reg/f:DI 16 argp)
(const_int -16 [0xfffffffffffffff0])) [0 S8 A8]))
(set (reg/f:DI 7 sp)
(plus:DI (reg/f:DI 16 argp)
(const_int -8 [0xfffffffffffffff8])))
])
"vartrack-1.c":15 71 {*popdi1}
(expr_list:REG_CFA_ADJUST_CFA
(set (reg/f:DI 7 sp)
(plus:DI (reg/f:DI 7 sp)
(const_int 8 [0x8]))) (nil)))
...
This patch fixes that by moving the stack_adjust modification after
adjust_insn in vt_initialize.
Bootstrapped and reg-tested on x86_64.
2018-07-16 Tom de Vries <tdevries@suse.de>
PR debug/86455
* var-tracking.c (vt_initialize): Fix pre_dec handling.
* gcc.target/i386/vartrack-1.c: New test.
From-SVN: r262687
Diffstat (limited to 'libssp')
0 files changed, 0 insertions, 0 deletions