summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/caller-save.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr45259.c42
4 files changed, 57 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d55ddbe4012..fff6268ff63 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45259
+ * caller-save.c (save_call_clobbered_regs): Only swap notes with
+ DEBUG_INSNs if n_regs_saved.
+
2010-08-12 Wei Guozhi <carrot@google.com>
PR target/44999
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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6ac7bbac087..84bd311b899 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/45259
+ * gcc.dg/pr45259.c: New test.
+
2010-08-12 Wei Guozhi <carrot@google.com>
PR target/44999
diff --git a/gcc/testsuite/gcc.dg/pr45259.c b/gcc/testsuite/gcc.dg/pr45259.c
new file mode 100644
index 00000000000..b8dc36503f8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr45259.c
@@ -0,0 +1,42 @@
+/* PR debug/45259 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -fpic -w" { target fpic } } */
+
+struct S { void (*bar) (long); };
+struct T { struct S *t; };
+int w;
+extern int baz (int);
+
+void
+foo (int x, int u, char *z)
+{
+ struct T *v;
+ static void *y[256] = { &&l1, &&l2 };
+ for (;;)
+ switch (x)
+ {
+ l2:
+ x = 9;
+ case 9:
+ goto *y[*z++];
+ case 10:
+ case 27:
+ case 54:
+ case 99:
+ case 100:
+ case 120:
+ case 122:
+ case 131:
+ case 132:
+ case 134:
+ case 141:
+ case 142:
+ v->t->bar (u);
+ v->t->bar (u);
+ case 143:
+ continue;
+ l1:
+ default:
+ baz (w);
+ }
+}