diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2009-10-08 19:20:22 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2009-10-08 19:20:22 +0000 |
commit | 968e57283eda9b6f9eb513b0e8572c8a9efaa79f (patch) | |
tree | 8b2386ebb2d6ce3706ad704edd3c86b164fbffa2 /gcc/regmove.c | |
parent | 42ccb890752a9456140ee00d12dbcf4fc62ac0a3 (diff) | |
download | gcc-968e57283eda9b6f9eb513b0e8572c8a9efaa79f.zip gcc-968e57283eda9b6f9eb513b0e8572c8a9efaa79f.tar.gz gcc-968e57283eda9b6f9eb513b0e8572c8a9efaa79f.tar.bz2 |
re PR debug/41353 (VTA missed-debug issues)
PR debug/41353
* regmove.c (regmove_backward_pass): Replace src with dst in the
debug insn, and check for dst before rather than after.
From-SVN: r152573
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r-- | gcc/regmove.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c index ab1a469..a411183 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -1117,23 +1117,28 @@ regmove_backward_pass (void) break; } - /* We can't make this change if SRC is read or + /* We can't make this change if DST is mentioned at + all in P, since we are going to change its value. + We can't make this change if SRC is read or partially written in P, since we are going to - eliminate SRC. We can't make this change - if DST is mentioned at all in P, - since we are going to change its value. */ - if (reg_overlap_mentioned_p (src, PATTERN (p))) + eliminate SRC. However, if it's a debug insn, we + can't refrain from making the change, for this + would cause codegen differences, so instead we + invalidate debug expressions that reference DST, + and adjust references to SRC in them so that they + become references to DST. */ + if (reg_mentioned_p (dst, PATTERN (p))) { if (DEBUG_INSN_P (p)) - validate_replace_rtx_group (dst, src, insn); + validate_change (p, &INSN_VAR_LOCATION_LOC (p), + gen_rtx_UNKNOWN_VAR_LOC (), 1); else break; } - if (reg_mentioned_p (dst, PATTERN (p))) + if (reg_overlap_mentioned_p (src, PATTERN (p))) { if (DEBUG_INSN_P (p)) - validate_change (p, &INSN_VAR_LOCATION_LOC (p), - gen_rtx_UNKNOWN_VAR_LOC (), 1); + validate_replace_rtx_group (src, dst, p); else break; } |