From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F0F33896804; Sat, 17 Apr 2021 17:53:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F0F33896804 From: "dclarke at blastwave dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/27750] local variables have wrong address and values on sparc64 Date: Sat, 17 Apr 2021 17:53:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dclarke at blastwave dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 17:53:59 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27750 --- Comment #2 from Dennis Clarke --- Seems like a good observation and I sort of wondered about the compiler here. So then with gcc 9.3.0 from the Debian folks :=20 mimas$ /usr/bin/sparc64-linux-gnu-gcc-9 --version=20 sparc64-linux-gnu-gcc-9 (Debian 9.3.0-21) 9.3.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. mimas$ cat -n foo.c=20 1 2 #include 3 #include 4 5 int main(int argc, char **argv) 6 { 7 int a =3D 1; 8 9 printf("a =3D %i\n", a); 10 11 printf("&a =3D %p\n", &a); 12 13 return EXIT_SUCCESS; 14 15 } 16 mimas$=20 mimas$ /usr/bin/sparc64-linux-gnu-gcc-9 -std=3Diso9899:1999 \ > -pedantic -pedantic-errors -fno-builtin -g -m64 -O0 \ > -mno-app-regs -mcpu=3Dultrasparc -mmemory-model=3Dtso \ > -o foo_gcc-9 foo.c=20 mimas$=20 mimas$ which gdb /home/dclarke/local/bin/gdb mimas$=20 mimas$ TERM=3Ddumb LC_ALL=3DC /home/dclarke/local/bin/gdb ./foo_gcc-9 GNU gdb (GDB) 10.1 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "sparc64-unknown-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./foo_gcc-9... (gdb) break foo.c:13 Breakpoint 1 at 0x878: file foo.c, line 13. (gdb) run Starting program: /home/dclarke/foo_gcc-9=20 a =3D 1 &a =3D 0x7fefffff5bc Breakpoint 1, main (argc=3D0, argv=3D0x0) at foo.c:13 13 return EXIT_SUCCESS; (gdb) print a $1 =3D 0 (gdb) print &a=20 $2 =3D (int *) 0x7feffa5d49c (gdb) cont Continuing. [Inferior 1 (process 53214) exited normally] (gdb) quit mimas$=20 I will attach two binaries :=20 1) foo_sparc64_gcc-10.xz made with gcc 10.2.1 2) foo_sparc64_gcc-9.xz made with gcc 9.3.0 I may go get sources to a previous gdb release and see if I can build and test. Thank you so much for your kind attention to this. --=20 You are receiving this mail because: You are on the CC list for the bug.=