From c207c6da70497edf962e5904d20e23732cf7de37 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 1 Nov 2012 17:53:05 +0000 Subject: [PATCH] * gdb.arch/amd64-pseudo.c (main): Mark registers that the testsuite changes as clobbered (e.g., amd64-dword.exp) so gcc doesn't try to use them. --- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.arch/amd64-pseudo.c | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8a756aa..ccd4994 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-11-01 Doug Evans + + * gdb.arch/amd64-pseudo.c (main): Mark registers that the testsuite + changes as clobbered (e.g., amd64-dword.exp) so gcc doesn't try to + use them. + 2012-10-31 Andrew Burgess PR cli/14772 diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo.c b/gdb/testsuite/gdb.arch/amd64-pseudo.c index f73ec10..4e8efc0 100644 --- a/gdb/testsuite/gdb.arch/amd64-pseudo.c +++ b/gdb/testsuite/gdb.arch/amd64-pseudo.c @@ -63,6 +63,14 @@ main (int argc, char **argv) : "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"); asm ("nop"); /* second breakpoint here */ + /* amd64-dword.exp writes eax-edi here. + Tell gcc they're clobbered so it doesn't try to keep "data" in + one of them. */ + asm ("" + : /* no outputs */ + : /* no inputs */ + : "eax", "ebx", "ecx", "edx", "esi", "edi"); + asm ("mov %%eax, 0(%0)\n\t" "mov %%ebx, 4(%0)\n\t" "mov %%ecx, 8(%0)\n\t" @@ -74,6 +82,14 @@ main (int argc, char **argv) : "eax", "ebx", "ecx", "edx", "esi", "edi"); asm ("nop"); /* third breakpoint here */ + /* amd64-dword.exp writes r8-r15 here. + Tell gcc they're clobbered so it doesn't try to keep "data" in + one of them. */ + asm ("" + : /* no outputs */ + : /* no inputs */ + : "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"); + asm ("mov %%r8d, 24(%0)\n\t" "mov %%r9d, 28(%0)\n\t" "mov %%r10d, 32(%0)\n\t" -- 2.7.4