public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/54363] New: ICE when compiling malformed struct initializers
@ 2012-08-24  4:31 kamaraju at gmail dot com
  2012-08-24  8:35 ` [Bug c/54363] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: kamaraju at gmail dot com @ 2012-08-24  4:31 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54363
           Summary: ICE when compiling malformed struct initializers
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kamaraju@gmail.com


Created attachment 28076
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28076
preprocessed source code with gcc 4.7.1

This bug is originally reported by Bernhard as
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684635

The following invalid code triggers an ICE with gcc-4.7

$cat t.c
struct bla{char **a;};void test(void){struct bla b = {.a =(char**){"a","b"}};}

$gcc -c t.c
t.c: In function ‘test’:
t.c:1:46: warning: initialization from incompatible pointer type [enabled by
default]
t.c:1:46: warning: (near initialization for ‘(anonymous)’) [enabled by default]
t.c:1:46: warning: excess elements in scalar initializer [enabled by default]
t.c:1:46: warning: (near initialization for ‘(anonymous)’) [enabled by default]
t.c:1:50: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccS0X8p2.out file, please attach this to
your bugreport.


Attaching the preprocessed source code as ccS0X8p2.out . I am using

$gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --enable-targets=all --with-arch-32=i586
--with-tune=generic --enable-checking=release --build=i486-linux-gnu
--host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.7.1 (Debian 4.7.1-2) 


The same ICE also occurs with gcc version 4.6.2 (Debian 4.6.2-12). But gcc
version 4.4.7 (Debian 4.4.7-1) compiles with a warning.

$gcc-4.4 -c t.c
t.c: In function ‘test’:
t.c:1: warning: initialization from incompatible pointer type
t.c:1: warning: excess elements in scalar initializer
t.c:1: warning: (near initialization for ‘(anonymous)’)

$gcc-4.4 -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.7-1'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.4 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-targets=all --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.4.7 (Debian 4.4.7-1)


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

end of thread, other threads:[~2013-04-03 18:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-24  4:31 [Bug c/54363] New: ICE when compiling malformed struct initializers kamaraju at gmail dot com
2012-08-24  8:35 ` [Bug c/54363] [4.6/4.7/4.8 Regression] " jakub at gcc dot gnu.org
2012-08-24  9:08 ` jakub at gcc dot gnu.org
2012-08-24 21:46 ` jakub at gcc dot gnu.org
2012-09-03 16:03 ` jakub at gcc dot gnu.org
2012-09-03 16:07 ` [Bug c/54363] [4.6 " jakub at gcc dot gnu.org
2013-04-03 18:17 ` jakub 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).