From: Mark Wielaard Date: Fri, 24 Jan 2020 10:26:25 +0000 (+0100) Subject: Fix tests/x86/incdec_alt.c asm for GCC10. X-Git-Tag: VALGRIND_3_16_0~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dab3249867615055a680cad7fccb22411587579;p=thirdparty%2Fvalgrind.git Fix tests/x86/incdec_alt.c asm for GCC10. 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. --- diff --git a/none/tests/x86/incdec_alt.c b/none/tests/x86/incdec_alt.c index 2db324275e..b8ff5c07e6 100644 --- a/none/tests/x86/incdec_alt.c +++ b/none/tests/x86/incdec_alt.c @@ -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 )