diff options
author | davem <davem@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-16 20:11:46 +0000 |
---|---|---|
committer | davem <davem@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-16 20:11:46 +0000 |
commit | ad35ffdcc7888aed602d86331506e63c17058b75 (patch) | |
tree | b8d49404e63d907a5eb23b0906cca7c4c3e8e084 /gcc/jump.c | |
parent | 71107e8593cbe3582d51ec81f82f7075513b89e5 (diff) | |
download | gcc-ad35ffdcc7888aed602d86331506e63c17058b75.tar.gz |
Fix var tracking ICE due to reorg.
If during reorg we delete a code label, and as a result we decide to
delete all the code following that label, we hit this condition in
jump.c:delete_related_insns():
if (was_code_label && prev && BARRIER_P (prev))
which passes and then we proceed to delete insns until we hit a
non-deleted code label.
During this traversal, we can end up deleting a CALL, but in doing so
we will leave the var tracking note for the call arguments around.
Later in dwarf2_var_location() we will ICE, because we can't find the
CALL when we search backwards for it.
The note searching scheme in the fix below is cribbed from code in
try_split() which has to handle a similar problem.
gcc/
* jump.c (delete_related_insns): If we remove a CALL, make sure
we delete it's NOTE_INSN_CALL_ARG_LOCATION note too.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187606 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 246fab02ff3..f5f644999d6 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1252,6 +1252,26 @@ delete_related_insns (rtx insn) if (next != 0 && BARRIER_P (next)) delete_insn (next); + /* If this is a call, then we have to remove the var tracking note + for the call arguments. */ + + if (CALL_P (insn) + || (NONJUMP_INSN_P (insn) + && GET_CODE (PATTERN (insn)) == SEQUENCE + && CALL_P (XVECEXP (PATTERN (insn), 0, 0)))) + { + rtx p = insn; + + for (p = NEXT_INSN (p); + p && NOTE_P (p); + p = NEXT_INSN (p)) + if (NOTE_KIND (p) == NOTE_INSN_CALL_ARG_LOCATION) + { + remove_insn (p); + break; + } + } + /* If deleting a jump, decrement the count of the label, and delete the label if it is now unused. */ |