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]

Re: Bug in h8300-hms-gcc


Low Sze Hau wrote:
When I compile the source file with the h8300-hms-gcc compiler, it does not
initialize the value (0,zero only) for the static variable :
	static int h = 0;

You didn't mention what gcc version you are using. That info matters. Please see
http://gcc.gnu.org/bugs.html
for info on reporting bugs.


I am guessing that you are using gcc-3.3.x or later. These gcc releases will put data intialized to zero in the bss section. It is the responsibility of the startup files to zero bss. I am guess that your startup files are broken, and are not properly initializing the bss section. This would not be a gcc bug.

However, you could work around this problem by using the -fno-zero-initialized-in-bss option. With this option, gcc will initialize the variable instead of putting it in bss.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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