Bug in h8300-hms-gcc
Jim Wilson
wilson@specifixinc.com
Thu Jul 15 02:55:00 GMT 2004
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
More information about the Gcc-bugs
mailing list