From: Khem Raj Date: Sat, 22 Dec 2018 23:28:40 +0000 (-0800) Subject: tests/amd64: Do not clobber %rsp register X-Git-Tag: VALGRIND_3_15_0~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=022f5af61bc3cbfa2b74ab355b0d2d30b3dab027;p=thirdparty%2Fvalgrind.git tests/amd64: Do not clobber %rsp register 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 --- diff --git a/NEWS b/NEWS index 18ee9d5948..f3dc7579fc 100644 --- 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) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/none/tests/amd64-linux/bug345887.c b/none/tests/amd64-linux/bug345887.c index 0f9237df54..269bd70247 100644 --- a/none/tests/amd64-linux/bug345887.c +++ b/none/tests/amd64-linux/bug345887.c @@ -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))