This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/3753
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, vanhoof at cita dot utoronto dot ca, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Subject: Re: c/3753
- From: Peter van Hoof <vanhoof at cita dot utoronto dot ca>
- Date: Tue, 21 Aug 2001 15:58:42 -0400
- Organization: Canadian Institute for Theoretical Astrophysics
I have reduced the code in bevington.c to its bare essentials that
can still trigger the bug in gcc 3.0.1 20010816 (prerelease). The
code is attached and is also included here
double sqrt(double);
void legfit(double[],long);
void legfit(double sigmaa[], long mode)
{
long j;
double varnce;
double alpha[510];
varnce = ( mode == 0 ) ? 2. : 1.;
for( j=0; j < 10; j++ )
alpha[j] = sqrt(varnce*sigmaa[j]);
return;
}
The core of the problem is that the bug gets triggered if more
than 4096 bytes need to be allocated on the stack. If the size of the
array alpha is reduced to 509 or smaller, the internal compiler error in
change_address, at emit-rtl.c:1635 is NOT triggered, for sizes 510 and
larger the compiler error IS triggered. Note that gcc 3.0.1 was not fully
installed. I am confident that this has nothing to do with the bug being
reported here.
A workaround for the problem would be to declare large arrays static, or
alternatively to use malloc instead of allocating them on the stack.
I hope this is of some use to you.
Kind regards,
Peter van Hoof.
Environment:
System: SunOS oblako 5.8 Generic_108528-09 sun4m sparc SUNW,SPARCstation-20
Architecture: sun4
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.0.1-20010816/configure --prefix=/opt/local
--enable-threads
oblako> /opt/local/temp/objdir/gcc/xgcc -B/opt/local/temp/objdir/gcc/ -v
-save-temps -ansi -c -O2 bevington.c
Reading specs from /opt/local/temp/objdir/gcc/specs
Configured with: ../gcc-3.0.1-20010816/configure --prefix=/opt/local
--enable-threads
Thread model: posix
gcc version 3.0.1 20010816 (prerelease)
/opt/local/temp/objdir/gcc/cpp0 -lang-c -std=c89 -v -iprefix
/opt/local/temp/objdir/gcc/../lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/ -isystem
/opt/local/temp/objdir/gcc/include -D__GNUC__=3 -D__GNUC_MINOR__=0
-D__GNUC_PATCHLEVEL__=1 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4
-D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__OPTIMIZE__
-D__STDC_HOSTED__=1 -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc
bevington.c bevington.i
GNU CPP version 3.0.1 20010816 (prerelease) (cpplib) (sparc)
ignoring nonexistent directory
"/opt/local/temp/objdir/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/include"
ignoring nonexistent directory
"/opt/local/temp/objdir/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/../../../../sparc-sun-solaris2.8/include"
ignoring nonexistent directory
"/opt/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/include"
ignoring nonexistent directory
"/opt/local/lib/gcc-lib/sparc-sun-solaris2.8/3.0.1/../../../../sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/local/temp/objdir/gcc/include
/usr/local/include
/usr/include
End of search list.
/opt/local/temp/objdir/gcc/cc1 -fpreprocessed bevington.i -quiet -dumpbase
bevington.c -ansi -O2 -ansi -version -o bevington.s
GNU CPP version 3.0.1 20010816 (prerelease) (cpplib) (sparc)
GNU C version 3.0.1 20010816 (prerelease) (sparc-sun-solaris2.8)
compiled by GNU C version 3.0.1 20010816 (prerelease).
bevington.c: In function `legfit':
bevington.c:14: Internal compiler error in change_address, at emit-rtl.c:1635
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3753&database=gcc
# 1 "bevington.c"
double sqrt(double);
void legfit(double[],long);
void legfit(double sigmaa[], long mode)
{
long j;
double varnce;
double alpha[510];
varnce = ( mode == 0 ) ? 2. : 1.;
for( j=0; j < 10; j++ )
alpha[j] = sqrt(varnce*sigmaa[j]);
return;
}
begin:vcard
n:van Hoof;Peter
tel;fax:+1-416-978-3921
tel;home:+1-416-513-1631
tel;work:+1-416-978-1777
x-mozilla-html:FALSE
url:http://www.cita.utoronto.ca/~vanhoof
org:Canadian Institute for Theoretical Astrophysics;McLennan Labs, University of Toronto
adr:;;60 St. George Street;Toronto, ON M5S 3H8;;;Canada
version:2.1
email;internet:vanhoof@cita.utoronto.ca
note:Home page: http://www.cita.utoronto.ca/~vanhoof
x-mozilla-cpt:;-23928
fn:Peter van Hoof
end:vcard