Bug 42262 - internal compiler error: in set_designator, at c-typeck.c:5771
Summary: internal compiler error: in set_designator, at c-typeck.c:5771
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.4.3
: P3 normal
Target Milestone: 4.9.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 13:24 UTC by Evgeny Kapun
Modified: 2013-11-29 21:26 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 3.2.3, 4.1.0, 4.3.0, 4.4.0, 4.5.0
Last reconfirmed: 2012-01-28 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgeny Kapun 2009-12-03 13:24:50 UTC
This code triggers ICE:

int a[] = {[0 ... 1] = "", [0] = ""};

GCC version info:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --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 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.2 (Ubuntu 4.4.2-2ubuntu1)

Exact command line: gcc test.c

GCC output:
test.c:1: internal compiler error: in set_designator, at c-typeck.c:5771
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
Comment 1 Andrew Pinski 2009-12-03 19:13:53 UTC
Confirmed.
Comment 2 Joseph S. Myers 2013-11-29 21:24:17 UTC
Author: jsm28
Date: Fri Nov 29 21:24:14 2013
New Revision: 205543

URL: http://gcc.gnu.org/viewcvs?rev=205543&root=gcc&view=rev
Log:
	PR c/42262
c:
	* c-typeck.c (process_init_element): Do not treat a string as
	initializing a whole array when used with a designator for an
	individual element.

testsuite:
	* gcc.dg/c99-init-5.c, gcc.dg/c99-init-6.c: New tests.

Added:
    trunk/gcc/testsuite/gcc.dg/c99-init-5.c
    trunk/gcc/testsuite/gcc.dg/c99-init-6.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Joseph S. Myers 2013-11-29 21:26:59 UTC
Fixed for 4.9.