public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11527] New: If an array  "designated intializer" in a struct causes a segv.
@ 2003-07-15 17:25 eamon at sonyoxford dot co dot uk
  2003-07-15 17:35 ` [Bug c/11527] " pinskia at physics dot uc dot edu
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: eamon at sonyoxford dot co dot uk @ 2003-07-15 17:25 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: If an array  "designated intializer" in a struct causes
                    a segv.
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eamon at sonyoxford dot co dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-slackware-linux
  GCC host triplet: i386-slackware-linux
GCC target triplet: i386-slackware-linux

The following (preprocessed) code causes a segv in 3.3 and 3.2.2

# 1 "t.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "t.c"
typedef struct smrdd_memory_blocks_s {
        int blocks;
                int block[];
        } smrdd_memory_blocks_t;

const smrdd_memory_blocks_t smrdd_memory_blocks={
        (3),
            {
                [5] = 0,
                [1] = 2,
            }
        };

It only happens with the struct, changing it too an int array is okay.

The values of the index (5 and 1) do not matter, nor do the values assigned
(0 and 2).

Thanks
Eamon.
(This is not the original code that found the problem, just the
distilled essence.)

=====================
gcc -save-temps -v -Wall t.c
Reading specs from /usr/lib/gcc-lib/i386-slackware-linux/3.3/specs
Configured with: ../gcc-3.3/configure --prefix=/usr --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld
--verbose --target=i386-slackware-linux --host=i386-slackware-linux
Thread model: posix
gcc version 3.3
 /usr/lib/gcc-lib/i386-slackware-linux/3.3/cc1 -E -quiet -v -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 t.c -Wall t.i
ignoring nonexistent directory "/usr/i386-slackware-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i386-slackware-linux/3.3/include
 /usr/include
End of search list.
 /usr/lib/gcc-lib/i386-slackware-linux/3.3/cc1 -fpreprocessed t.i -quiet
-dumpbase t.c -auxbase t -Wall -version -o t.s
GNU C version 3.3 (i386-slackware-linux)
        compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=129115
t.c:11: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


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

end of thread, other threads:[~2004-03-26 23:07 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-15 17:25 [Bug c/11527] New: If an array "designated intializer" in a struct causes a segv eamon at sonyoxford dot co dot uk
2003-07-15 17:35 ` [Bug c/11527] " pinskia at physics dot uc dot edu
2003-07-18 22:28 ` dhazeghi at yahoo dot com
2003-07-18 22:37 ` [Bug c/11527] [3.3/3.4 Regression] " pinskia at physics dot uc dot edu
2003-08-05 19:30 ` janis187 at us dot ibm dot com
2003-09-05  7:14 ` mmitchel at gcc dot gnu dot org
2003-10-16  9:43 ` mmitchel at gcc dot gnu dot org
2003-12-21 20:49 ` gdr at gcc dot gnu dot org
2003-12-29 18:52 ` pinskia at gcc dot gnu dot org
2004-01-11  1:48 ` pinskia at gcc dot gnu dot org
2004-01-12 23:39 ` steven at gcc dot gnu dot org
2004-03-24 16:54 ` [Bug c/11527] [3.3/3.4/3.5 " pinskia at gcc dot gnu dot org
2004-03-24 22:55 ` rth at gcc dot gnu dot org
2004-03-26  0:36 ` rth at gcc dot gnu dot org
2004-03-26  0:47 ` cvs-commit at gcc dot gnu dot org
2004-03-26  0:50 ` [Bug c/11527] [3.3/3.4 " rth at gcc dot gnu dot org
2004-03-26  6:45 ` gdr at integrable-solutions dot net
2004-03-26 22:37 ` cvs-commit at gcc dot gnu dot org
2004-03-26 23:04 ` cvs-commit at gcc dot gnu dot org
2004-03-26 23:07 ` [Bug c/11527] " rth at gcc dot gnu dot org
2004-03-26 23:07 ` rth at gcc dot gnu dot 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).