aboutsummaryrefslogtreecommitdiff
path: root/gcc/caller-save.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-08-12 09:04:48 +0000
committerJakub Jelinek <jakub@redhat.com>2010-08-12 09:04:48 +0000
commit3c0d1a5c790e7320707d78bf28cf77a0a4d347e7 (patch)
tree05dfe66d78ab3b75054cabbf2e7413b15c243fc9 /gcc/caller-save.c
parentb88a3b050fc2d5fecd10fb7d3bc45b6f88fe6ec0 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@163185 138bc75d-0d04-0410-961f-82ee72b054a4
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);