https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94134
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Well, in the testcase you've provided the variable isn't modified in any way (nor used), so there is nothing wrong in optimizing it away completely or putting it into a read-only section. But say: static volatile int zero = 0; static volatile int one = 1; int main () { zero++; one++; return 0; } shows it is a real bug, assuming that the .text section is not modifiable on pdp11-aout.