https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120987

--- Comment #14 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 61838
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61838&action=edit
test.c

I've managed to write a synthetic example:
...
$ g++-14 test.c -O0 -g; ./a.out
msg: 'No symbol table is loaded.  Use the "file" command.'
$ g++-14 test.c -O2 -g; ./a.out
msg: 'Y'
$ g++-14 test.c -O1 -g; ./a.out
msg: '*�'
...

Interestingly, also reproduces without sra:
...
$ g++-14 test.c -O2 -g -fno-tree-sra -fno-ipa-sra; ./a.out
msg: '��'
...

Also reproduces with gcc 15 (gcc version 15.1.1 20250528 (SUSE Linux):
...
$ g++-15 test.c -O2; ./a.out
msg: '�m'
...

Doesn't reproduce with gcc 7-13:
...
$ for n in "" -8 -9 -10 -11 -12 -13 -14; do g++$n test.c -O2 -g; ./a.out; done
msg: 'No symbol table is loaded.  Use the "file" command.'
msg: 'No symbol table is loaded.  Use the "file" command.'
msg: 'No symbol table is loaded.  Use the "file" command.'
msg: 'No symbol table is loaded.  Use the "file" command.'
msg: 'No symbol table is loaded.  Use the "file" command.'
msg: 'No symbol table is loaded.  Use the "file" command.'
msg: 'No symbol table is loaded.  Use the "file" command.'
msg: '�h'
...

Reply via email to