https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94469
--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> --- (In reply to Tom de Vries from comment #2) (In reply to Richard Biener from comment #3) > Ah, thanks for the hints - that's something I can work with more easily than > an Ada testcase ;) Sure :) FWIW, the gdb behaviour is somewhat flaky, so this reproduces what I had: ... $ gdb -batch a.out -ex "p aaa" -ex "p bbb" -ex "p ccc" $1 = 0 $2 = <optimized out> $3 = <optimized out> ... but if I drop printing aaa, I do get the value of bbb: ... $ gdb -batch a.out -ex "p bbb" -ex "p ccc" $1 = 0 $2 = <optimized out> ... So this also seems to interact with partial symbol tables. To reproduce this reliably, just skip partial symbols tables using -readnow: ... $ gdb -readnow -batch a.out -ex "p aaa" -ex "p bbb" -ex "p ccc" $1 = <optimized out> $2 = <optimized out> $3 = <optimized out> ... and now also the problem surfaces for aaa.