This is the mail archive of the gcc@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. Our compiler configuration is shown below. Our platform is a PowerPC 745x running Yellow Dog Linux 3.0. Thanks.

Mike LeBlanc
SKY Computers, Inc.

gcc -v
Reading specs from /usr/mike/lib/gcc-lib/ppc-sky-linux/3.3/specs
Configured with: ../gnu-tool-chain/gcc/configure --with-cpu=7450 --enable-altivec
--enable-shared --enable-threads=posix --enable-languages=c,c++ --disable-checking
--with-system-zlib --enable-__cxa_atexit --host=ppc-sky-linux --target=ppc-sky-linux
--prefix=/usr/mike : (reconfigured)
Thread model: posix
gcc version 3.3



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