]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix tests/x86/incdec_alt.c asm for GCC10.
authorMark Wielaard <mark@klomp.org>
Fri, 24 Jan 2020 10:26:25 +0000 (11:26 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 24 Jan 2020 10:43:10 +0000 (11:43 +0100)
Thanks to Jakub Jelinek. The test is broken. It blindly assumes the
toplevel inline asm is placed into some sensible section, but that is
a wrong assumption. The right thing is to start the inline asm with
.text directive and end with .previous. The reason gcc 10 breaks it
is the -fno-common default, the int r1, ... vars are emitted into .bss
section and that is the section that is current when the inline asm is
emitted previously they were in .common at the end of the assembly file.

none/tests/x86/incdec_alt.c

index 2db324275ed7a821b72d1c2d40d9bb616ad64fd3..b8ff5c07e68b9f2bfc3f3d5e0ee01bb8f8b1a959 100644 (file)
@@ -8,6 +8,7 @@ int r1,r2,r3,r4,r5,r6,r7,r8,a1,a2;
 
 extern void foo ( void );
 asm("\n"
+".text\n"
 VG_SYM(foo) ":\n"
 "\tpushl $0\n"
 "\tpopfl\n"
@@ -49,6 +50,7 @@ VG_SYM(foo) ":\n"
 "\tpopl " VG_SYM(r8) "\n"
 
 "\tret\n"
+".previous\n"
 );
 
 int main ( void )