User account creation filtered due to spam.

Bug 29135 - internal compiler error at cfgexpand.c:515
Summary: internal compiler error at cfgexpand.c:515
Status: RESOLVED DUPLICATE of bug 21107
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.4
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-19 04:10 UTC by David Ellis
Modified: 2006-09-20 04:56 UTC (History)
2 users (show)

See Also:
Host: i486-pc-linux-gnu
Target: i486-pc-linux-gnu
Build: i486-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Preprocessed source. (16.51 KB, text/plain)
2006-09-19 04:12 UTC, David Ellis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Ellis 2006-09-19 04:10:23 UTC
/usr/bin/gcc -Wall -pedantic -g   -c -o desh.o desh.c

desh.c: In function 'main':
desh.c:256: internal compiler error: in expand_one_stack_var_at, at cfgexpand.c:515
Please submit a full bug report,
with preprocessed source if appropriate.

gcc -v:
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.0 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk-default --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.0-1.4.2.0/jre --enable-mpfr --disable-werror --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.0.4 20060507 (prerelease) (Debian 4.0.3-3)

The preprocessed source (desh.i) should be attached.
Comment 1 David Ellis 2006-09-19 04:12:59 UTC
Created attachment 12293 [details]
Preprocessed source.

The preprocessed source file that causes the internal compiler error. Still not sure exactly what part of it is responsible...
Comment 2 Andrew Pinski 2006-09-19 04:19:55 UTC
char input[((size_t)~0 >> 1)];

hehehehehehehe.

Anyways this has been fixed for 4.1.0 by rejecting this code saying there is a stack (32bit) overflow.

*** This bug has been marked as a duplicate of 21107 ***
Comment 3 David Ellis 2006-09-19 21:49:16 UTC
Subject: Re:  internal compiler error at cfgexpand.c:515

It seems to still be a problem with 4.1.1 (released 20060511). Maybe
this is a slightly different problem?

If not, what version has fixed this? Or, how can I change my code to
avoid the stack overflow?

Thanks,

David

/usr/bin/gcc-4.1 -Wall -pedantic -g   -c -o desh.o desh.c -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,fortran,objc,obj-c++,ada,treelang
--prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/jre
--enable-mpfr --with-tune=i686 --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.1 20060511 (prerelease) (Debian 4.1.0-4)
/usr/lib/gcc/i486-linux-gnu/4.1.1/cc1 -quiet -v desh.c -quiet -dumpbase
desh.c -mtune=i686 -auxbase-strip desh.o -g -Wall -pedantic -version -o
/tmp/ccBamZow.s
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/i486-linux-gnu/4.1.1/include
/usr/include
End of search list.
GNU C version 4.1.1 20060511 (prerelease) (Debian 4.1.0-4) (i486-linux-gnu)
        compiled by GNU C version 4.1.1 20060511 (prerelease) (Debian
4.1.0-4).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0094fb0542a7fdae5375a0ba89472de3
desh.c: In function 'main':
desh.c:256: internal compiler error: in expand_one_stack_var_at, at
cfgexpand.c:515
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.

pinskia at gcc dot gnu dot org wrote:

>------- Comment #2 from pinskia at gcc dot gnu dot org  2006-09-19 04:19 -------
>char input[((size_t)~0 >> 1)];
>
>hehehehehehehe.
>
>Anyways this has been fixed for 4.1.0 by rejecting this code saying there is a
>stack (32bit) overflow.
>
>*** This bug has been marked as a duplicate of 21107 ***
>  
>

Comment 4 Andrew Pinski 2006-09-20 04:56:13 UTC
[pinskia@celery ~]$ ~/gcc-4.1/bin/gcc t.i -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/pinskia/src/gcc/gcc-4.1/gcc/configure --prefix=/home/pinskia/gcc-4.1/
Thread model: posix
gcc version 4.1.2 20060917 (prerelease)
 /home/pinskia/gcc-4.1/bin/../libexec/gcc/i686-pc-linux-gnu/4.1.2/cc1 -fpreprocessed t.i -quiet -dumpbase t.i -mtune=pentiumpro -auxbase t -version -o /tmp/cc4wbv0b.s
GNU C version 4.1.2 20060917 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 4.1.2 20060917 (prerelease).
GGC heuristics: --param ggc-min-expand=94 --param ggc-min-heapsize=121165
Compiler executable checksum: 3ccc0164c9173719947ca913043b7105
desh.c: In function ‘main’:
desh.c:256: error: total size of local objects too large

It is fixed for me.
Well for one replace the size on input to be something more resonable because ((size_t)-1)>>2 is half the memory which is really invalid for the stack.