From 85819864f7cbf813cde00cf3bed30a38414e1bd8 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 28 Nov 2022 13:57:17 +0100 Subject: [PATCH] [gdb/testsuite] Fix gdb.arch/altivec-regs.exp with gcc 4.8.5 On powerpc64le-linux, using gcc 4.8.5, I run into: ... (gdb) PASS: gdb.arch/altivec-regs.exp: next (1) next^M 11 c = vec_add (a, b);^M (gdb) PASS: gdb.arch/altivec-regs.exp: next (2) print/x a^M $67 = {0xfefefefe, 0xfefefefe, 0xfefefefe, 0xfefefefe}^M (gdb) FAIL: gdb.arch/altivec-regs.exp: print vector parameter a ... Looking at the disassembly and the debug info, it's clear why there's a FAIL. The debug info says that the variable can be found at some stack location, but the instructions don't seem to be writing there. We can work around this by marking variable a volatile. Likewise for b. Note that marking the variables as volatile doesn't change the location information. Tested on power64le-linux. --- 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 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 = ((vector unsigned int) vec_splat_u8(2)); -- 2.30.2