From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 38E873858C62; Mon, 28 Nov 2022 12:57:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38E873858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669640240; bh=+kZO2DGSrmZaqI1av3QiAQVH7Imzc/J9WPKETZp+52o=; h=From:To:Subject:Date:From; b=IdS+B61FT6bT+SNIn82csfnfrkIT7hOquW55KAS47oFdFosOqpOGm4d8wl4bwtFW2 2H6fjZwQi2iA4W/3BMr8LyfyyVkWxZnOhWT+8cZXzzRyQrjol0MOZkiuZOWFG7ff0A T29dOki6hx9uQm97OaE1edKYWVZHe4jAf5DICflI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.arch/altivec-regs.exp with gcc 4.8.5 X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 2650ea9730e31fc5c9111afc1a689dbca76707f5 X-Git-Newrev: 85819864f7cbf813cde00cf3bed30a38414e1bd8 Message-Id: <20221128125720.38E873858C62@sourceware.org> Date: Mon, 28 Nov 2022 12:57:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D85819864f7cb= f813cde00cf3bed30a38414e1bd8 commit 85819864f7cbf813cde00cf3bed30a38414e1bd8 Author: Tom de Vries Date: Mon Nov 28 13:57:17 2022 +0100 [gdb/testsuite] Fix gdb.arch/altivec-regs.exp with gcc 4.8.5 =20 On powerpc64le-linux, using gcc 4.8.5, I run into: ... (gdb) PASS: gdb.arch/altivec-regs.exp: next (1) next^M 11 c =3D vec_add (a, b);^M (gdb) PASS: gdb.arch/altivec-regs.exp: next (2) print/x a^M $67 =3D {0xfefefefe, 0xfefefefe, 0xfefefefe, 0xfefefefe}^M (gdb) FAIL: gdb.arch/altivec-regs.exp: print vector parameter a ... =20 Looking at the disassembly and the debug info, it's clear why there's a FAIL. =20 The debug info says that the variable can be found at some stack locati= on, but the instructions don't seem to be writing there. =20 We can work around this by marking variable a volatile. Likewise for b. =20 Note that marking the variables as volatile doesn't change the location information. =20 Tested on power64le-linux. Diff: --- gdb/testsuite/gdb.arch/altivec-regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.arch/altivec-regs.c b/gdb/testsuite/gdb.arch= /altivec-regs.c index 4d4fe3f5dbb..8f3b729fe3f 100644 --- a/gdb/testsuite/gdb.arch/altivec-regs.c +++ b/gdb/testsuite/gdb.arch/altivec-regs.c @@ -2,7 +2,7 @@ #include =20 vector unsigned int -vector_fun (vector unsigned int a, vector unsigned int b) +vector_fun (volatile vector unsigned int a, volatile vector unsigned int b) { vector unsigned int c; a =3D ((vector unsigned int) vec_splat_u8(2));