From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27208 invoked by alias); 24 Aug 2012 04:31:14 -0000 Received: (qmail 27195 invoked by uid 22791); 24 Aug 2012 04:31:11 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BJ,TW_CX,TW_DC,TW_GX X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Aug 2012 04:30:58 +0000 From: "kamaraju at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/54363] New: ICE when compiling malformed struct initializers Date: Fri, 24 Aug 2012 04:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kamaraju at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg01651.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54363 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=3D28076 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=3D684635 The following invalid code triggers an ICE with gcc-4.7 $cat t.c struct bla{char **a;};void test(void){struct bla b =3D {.a =3D(char**){"a",= "b"}};} $gcc -c t.c t.c: In function =E2=80=98test=E2=80=99: t.c:1:46: warning: initialization from incompatible pointer type [enabled by default] t.c:1:46: warning: (near initialization for =E2=80=98(anonymous)=E2=80=99) = [enabled by default] t.c:1:46: warning: excess elements in scalar initializer [enabled by defaul= t] t.c:1:46: warning: (near initialization for =E2=80=98(anonymous)=E2=80=99) = [enabled by default] t.c:1:50: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See 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=3Dgcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc/i486-linux-gnu/4.7/lto-wrapper Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Debian 4.7.1-2' --with-bugurl=3Dfile:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=3Dc,c++,go,fortran,objc,obj-c++ --prefix=3D/usr --program-suffix=3D-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --with-gxx-include-dir=3D/usr/include/c++/4.7 --libdir=3D/usr/lib --enable-nls --with-sysroot=3D/ --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dyes --enable-gnu-unique-= object --enable-plugin --enable-objc-gc --enable-targets=3Dall --with-arch-32=3Di5= 86 --with-tune=3Dgeneric --enable-checking=3Drelease --build=3Di486-linux-gnu --host=3Di486-linux-gnu --target=3Di486-linux-gnu Thread model: posix gcc version 4.7.1 (Debian 4.7.1-2)=20 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 =E2=80=98test=E2=80=99: 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 =E2=80=98(anonymous)=E2=80=99) $gcc-4.4 -v Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Debian 4.4.7-1' --with-bugurl=3Dfile:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=3Dc,c++,fortran,objc,obj-c++ --prefix=3D/usr --program-suffix=3D-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --with-gxx-include-dir=3D/usr/include/c++/4.4 --libdir=3D/usr/lib --enable-nls --enable-clocale=3Dgnu --enable-libstdcxx-= debug --enable-objc-gc --enable-targets=3Dall --with-arch-32=3Di586 --with-tune= =3Dgeneric --enable-checking=3Drelease --build=3Di486-linux-gnu --host=3Di486-linux-gnu --target=3Di486-linux-gnu Thread model: posix gcc version 4.4.7 (Debian 4.4.7-1)