public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/58695] New: MSP430 zero-initialized array remains uninitialized with -nostartfiles
@ 2013-10-11 22:38 quandary at remstate dot com
  2013-10-11 23:02 ` [Bug target/58695] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: quandary at remstate dot com @ 2013-10-11 22:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58695

            Bug ID: 58695
           Summary: MSP430 zero-initialized array remains uninitialized
                    with -nostartfiles
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: quandary at remstate dot com

Created attachment 30986
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30986&action=edit
Should initialize a 16-byte array to all zeroes

When initializing (non-constant) arrays with a list of constants, an all-zero
array is left uninitialized when -nostartfiles is specified. Arrays with any
non-zero elements are still initialized properly.

At the assembly level, the difference in behavior seems to be that the compiler
puts all-zero arrays into .bss, whereas the compiler puts arrays with non-zero
elements into .data. I would suggest that in the case where -nostartfiles is
specified, an explicit all-zero array should be placed into .data so that
initialization/programming takes place per the programmer's intent.


msp430-elf-gcc -v:

Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/msp430-elf/gcc-bin/9999/msp430-elf-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/msp430-elf/9999/lto-wrapper
Target: msp430-elf
Configured with:
/var/tmp/portage/cross-msp430-elf/gcc-9999/work/gcc-9999/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/msp430-elf/gcc-bin/9999
--includedir=/usr/lib/gcc/msp430-elf/9999/include
--datadir=/usr/share/gcc-data/msp430-elf/9999
--mandir=/usr/share/gcc-data/msp430-elf/9999/man
--infodir=/usr/share/gcc-data/msp430-elf/9999/info
--with-gxx-include-dir=/usr/lib/gcc/msp430-elf/9999/include/g++-v9999
--host=x86_64-pc-linux-gnu --target=msp430-elf --build=x86_64-pc-linux-gnu
--disable-altivec --disable-fixed-point --without-cloog --disable-lto
--enable-nls --without-included-gettext --with-system-zlib --enable-obsolete
--disable-werror --enable-secureplt --enable-multilib --disable-libmudflap
--disable-libssp --disable-libgomp
--with-python-dir=/share/gcc-data/msp430-elf/9999/python
--enable-poison-system-directories --enable-checking=release --disable-libgcj
--disable-build-with-cxx --disable-build-poststage1-with-cxx
--disable-libquadmath --enable-languages=c --disable-shared --disable-libatomic
--disable-threads --without-headers --disable-bootstrap --with-newlib
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo SVN'
Thread model: single
gcc version 9999 20131011 (experimental) rev. 203465 (Gentoo SVN) 


Command line that triggers the bug:

msp430-elf-gcc -save-temps -nostartfiles -o bug.elf zero_init.c


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-12  0:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 22:38 [Bug target/58695] New: MSP430 zero-initialized array remains uninitialized with -nostartfiles quandary at remstate dot com
2013-10-11 23:02 ` [Bug target/58695] " pinskia at gcc dot gnu.org
2013-10-11 23:37 ` quandary at remstate dot com
2013-10-12  0:35 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).