summaryrefslogtreecommitdiff
path: root/gcc/caller-save.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-08-12 11:04:48 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-08-12 11:04:48 +0200
commit49b48605c822542b0ce623db4d5188ed3ae79401 (patch)
tree05dfe66d78ab3b75054cabbf2e7413b15c243fc9 /gcc/caller-save.c
parent3565ffedc8f301d0f13d7c5d2aa89ea8261c2299 (diff)
downloadgcc-49b48605c822542b0ce623db4d5188ed3ae79401.tar.gz
re PR debug/45259 (ICE in save_call_clobbered_regs)
PR debug/45259 * caller-save.c (save_call_clobbered_regs): Only swap notes with DEBUG_INSNs if n_regs_saved. * gcc.dg/pr45259.c: New test. From-SVN: r163185
Diffstat (limited to 'gcc/caller-save.c')
-rw-r--r--gcc/caller-save.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 446da51acdf..9ca8592bf34 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -868,7 +868,10 @@ save_call_clobbered_regs (void)
remain saved. If the last insn in the block is a JUMP_INSN, put
the restore before the insn, otherwise, put it after the insn. */
- if (DEBUG_INSN_P (insn) && last && last->block == chain->block)
+ if (n_regs_saved
+ && DEBUG_INSN_P (insn)
+ && last
+ && last->block == chain->block)
{
rtx ins, prev;
basic_block bb = BLOCK_FOR_INSN (insn);