]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
tests/amd64: Do not clobber %rsp register
authorKhem Raj <raj.khem@gmail.com>
Sat, 22 Dec 2018 23:28:40 +0000 (15:28 -0800)
committerMark Wielaard <mark@klomp.org>
Sun, 23 Dec 2018 22:09:28 +0000 (23:09 +0100)
This is seen with gcc-9.0 compiler now which is fix that gcc community
did recently
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813

Signed-off-by: Khem Raj <raj.khem@gmail.com>
NEWS
none/tests/amd64-linux/bug345887.c

diff --git a/NEWS b/NEWS
index 18ee9d59486b8e81298621e8f763de18c49a3683..f3dc7579fc47c4403e0a9fad71cdcb5887ae399c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -75,6 +75,7 @@ where XXXXXX is the bug number as listed below.
 402134  assertion fail in mc_translate.c (noteTmpUsesIn) Iex_VECRET on arm64
 402327  Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x13 (DW_OP_drop)
 402395  coregrind/vgdb-invoker-solaris.c: 2 * poor error checking
+402480  Do not use %rsp in clobber list
 
 Release 3.14.0 (9 October 2018)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 0f9237df541a37f92f2fa1dcb03065807e650379..269bd7024777b9f396601ad69b4f0b9dae71d9b8 100644 (file)
@@ -20,13 +20,17 @@ static void inner(void)
       "movq $0x10d, %%r14\n"
       "movq $0x10e, %%r15\n"
       // not %rbp as mdb is then not able to reconstruct stack trace
+      // Do change %rsp (to test a bogus stack pointer),
+      // but don't add %rsp to the clobber list since gcc ignores it
+      // and since gcc >= 9.0 errors about it
+      // see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813
       "movq $0x10f, %%rsp\n"
       "movq $0x1234, (%%rax)\n"  // should cause SEGV here
       "ud2"                      // should never get here
       : // no output registers
       : // no input registers
       : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
-        "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "%rsp");
+        "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15");
 }
 
 __attribute__((noinline))