From 968e57283eda9b6f9eb513b0e8572c8a9efaa79f Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Thu, 8 Oct 2009 19:20:22 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/regmove.c | 27 ++++++++++++++++----------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e91ab6d48d03..a7e2290d42ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-10-08 Alexandre Oliva + + PR debug/41353 + * regmove.c (regmove_backward_pass): Replace src with dst in the + debug insn, and check for dst before rather than after. + 2009-10-08 Janis Johnson * config/rs6000/rs6000.c (rs6000_delegitimize_address): Remove. diff --git a/gcc/regmove.c b/gcc/regmove.c index ab1a4696d367..a411183c5504 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -1117,18 +1117,16 @@ 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))) - { - if (DEBUG_INSN_P (p)) - validate_replace_rtx_group (dst, src, insn); - else - break; - } + 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)) @@ -1137,6 +1135,13 @@ regmove_backward_pass (void) else break; } + if (reg_overlap_mentioned_p (src, PATTERN (p))) + { + if (DEBUG_INSN_P (p)) + validate_replace_rtx_group (src, dst, p); + else + break; + } /* If we have passed a call instruction, and the pseudo-reg DST is not already live across a call,