public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18253] New: segfault on dynamic size array init
@ 2004-10-31 17:01 atmosfear at users dot sourceforge dot net
  2004-10-31 17:04 ` [Bug c/18253] " atmosfear at users dot sourceforge dot net
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: atmosfear at users dot sourceforge dot net @ 2004-10-31 17:01 UTC (permalink / raw)
  To: gcc-bugs

gcc 4.0.0 build 20041024 segfault in the case where a multidimensional array 
is inited with variable size dimension based on a variable declared 
dynamically earlyier in the same block, eg: 
foo(int y){ 
  const int a= y? 1 : 2; 
  int b[2][a][4]; 
  [...] (code acessing b); 
} 
 
The bug happened to me compiling libavcodec/ffv1.c from current-cvs FFmpeg. 
The affected code segment looks like this (also see attached preprocessed 
source): 
---snip--- 
static void encode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int 
stride){ 
    int x, y, p, i; 
    const int ring_size= s->avctx->context_model ? 3 : 2; 
    int_fast16_t sample_buffer[3][ring_size][w+6], *sample[3][ring_size]; 
    s->run_index=0; 
    memset(sample_buffer, 0, sizeof(sample_buffer)); 
    [...more code...] 
} 
---snip--- 
 
The commandline used was: 
---snip--- 
gcc4 -save-temps -I../libvo -I../../libvo -I/usr/X11R6/include -fno-PIC -g -O4 
-march=pentium4 -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer 
-D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_AV_CONFIG_H 
-I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE  -c -o ffv1.o 
ffv1.c 
---snip--- 
 
Resulting output: 
---snip--- 
gcc4: warning: -pipe ignored because -save-temps specified 
ffv1.c: In function 'encode_rgb_frame': 
ffv1.c:443: 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. 
---snip--- 
 
GCC Build Info: 
---snip--- 
 Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/4.0.0/specs 
Configured with: /var/tmp/portage/gcc-4.0.0/work/gcc-4.0-20041024/configure 
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.0 
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.0.0/include 
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.0 
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.0/man 
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.0/info --enable-shared 
--host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib 
--enable-languages=c,c++,java --enable-threads=posix --enable-long-long 
--disable-checking --enable-cstdio=stdio --enable-clocale=generic 
--enable-__cxa_atexit --enable-version-specific-runtime-libs 
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.0.0/include/g++-v4 
--with-local-prefix=/usr/local --disable-werror --enable-shared --enable-nls 
--without-included-gettext --x-includes=/usr/X11R6/include 
--x-libraries=/usr/X11R6/lib --enable-interpreter --enable-java-awt=xlib 
--with-x --disable-multilib 
Thread model: posix 
gcc version 4.0.0 20041024 (experimental) 
---snip--- 
 
GCC was build with gentoo gcc-3.4.2-r2 using inofficial gentoo gcc-4.0.0 
ebuild from: 
http://jaysonking.com/gcc-4.0.0.ebuild 
 
(Now hopefully I can attach the preproessed source, after adding the bug :-)

-- 
           Summary: segfault on dynamic size array init
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: atmosfear at users dot sourceforge dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c/18253] segfault on dynamic size array init
  2004-10-31 17:01 [Bug c/18253] New: segfault on dynamic size array init atmosfear at users dot sourceforge dot net
@ 2004-10-31 17:04 ` atmosfear at users dot sourceforge dot net
  2004-10-31 17:05 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: atmosfear at users dot sourceforge dot net @ 2004-10-31 17:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From atmosfear at users dot sourceforge dot net  2004-10-31 17:04 -------
Created an attachment (id=7444)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7444&action=view)
Preprocessed ffv1.c gzipped


-- 


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


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

* [Bug c/18253] segfault on dynamic size array init
  2004-10-31 17:01 [Bug c/18253] New: segfault on dynamic size array init atmosfear at users dot sourceforge dot net
  2004-10-31 17:04 ` [Bug c/18253] " atmosfear at users dot sourceforge dot net
@ 2004-10-31 17:05 ` pinskia at gcc dot gnu dot org
  2004-10-31 17:36 ` phython at gcc dot gnu dot org
  2004-10-31 17:37 ` phython at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-31 17:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-31 17:05 -------


*** This bug has been marked as a duplicate of 18067 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c/18253] segfault on dynamic size array init
  2004-10-31 17:01 [Bug c/18253] New: segfault on dynamic size array init atmosfear at users dot sourceforge dot net
  2004-10-31 17:04 ` [Bug c/18253] " atmosfear at users dot sourceforge dot net
  2004-10-31 17:05 ` pinskia at gcc dot gnu dot org
@ 2004-10-31 17:36 ` phython at gcc dot gnu dot org
  2004-10-31 17:37 ` phython at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: phython at gcc dot gnu dot org @ 2004-10-31 17:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From phython at gcc dot gnu dot org  2004-10-31 17:36 -------
 This is a duplicate of PR18005.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


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


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

* [Bug c/18253] segfault on dynamic size array init
  2004-10-31 17:01 [Bug c/18253] New: segfault on dynamic size array init atmosfear at users dot sourceforge dot net
                   ` (2 preceding siblings ...)
  2004-10-31 17:36 ` phython at gcc dot gnu dot org
@ 2004-10-31 17:37 ` phython at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: phython at gcc dot gnu dot org @ 2004-10-31 17:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From phython at gcc dot gnu dot org  2004-10-31 17:37 -------


*** This bug has been marked as a duplicate of 18005 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2004-10-31 17:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-31 17:01 [Bug c/18253] New: segfault on dynamic size array init atmosfear at users dot sourceforge dot net
2004-10-31 17:04 ` [Bug c/18253] " atmosfear at users dot sourceforge dot net
2004-10-31 17:05 ` pinskia at gcc dot gnu dot org
2004-10-31 17:36 ` phython at gcc dot gnu dot org
2004-10-31 17:37 ` phython 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).