This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-fzero-initialized-in-bss


We're having some obscure failures with code containing things like

static struct something *ptr = 0;

The variable ptr is placed in .bss (.sbss with -Os) and allocated via .zero. Running the program under gdb shows the value as -1. If I recompile with -fno-zero-initialized-in-bss, it goes to .data, the value appears as 0, and the program runs as expected.

I apologize in advance if this issue has already been addressed. I have not crawled through all the archives.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]