This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/20361] New: -fmax-stack-var-size=N not working for equivalence
- From: "paulthomas2 at wanadoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2005 16:33:11 -0000
- Subject: [Bug fortran/20361] New: -fmax-stack-var-size=N not working for equivalence
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The enclosed example causes a segmentation fault at runtime under Cygwin.
Reducing the length of pool1 by 1 allows it to run. This length looks like
2^18 less a header block so paging/memory/stack was suspected. Note this does
not occur in Linux or native Windows versions of gfortran.
Setting -fmax-stack-var-size appropriately makes no difference but
d:/irun/bin/gfortran -Wl,--stack=2100000 fixes the problem.
-fmax-stack-var-size seems to work for non-equivalence variables but is broken
for equivalenced variables - see correspondence on the list between myself and
A.Pinskia dated 6-7 March 2005 under the subject: Re: Equivalence segfault in
TEST_FPU.F90
Test programme and output:
__________________________
program test_equivalence
real*8 :: pool1(260105),pool2(1)
equivalence (pool1,pool2)
end program test_equivalence
$ d:/irun/bin/gfortran -v test_prequi.f90
Driving: d:/irun/bin/gfortran -v test_prequi.f90 -lgfortranbegin -lgfortran
Using built-in specs.
Configured with: ../gcc/configure --with-mpfr=/gmp-gcc4 --with-gmp=/gmp-gcc4 -en
able-languages=c,f95 --prefix=/cygdrive/d/irun
Thread model: single
gcc version 4.0.0 20050129 (experimental)
/cygdrive/d/irun/libexec/gcc/i686-pc-cygwin/4.0.0/f951.exe test_prequi.f90 -qui
et -dumpbase test_prequi.f90 -mtune=pentiumpro -auxbase test_prequi -version -o
/cygdrive/c/DOCUME~1/PAULTH~1/LOCALS~1/Temp/cc1r1KUq.s
GNU F95 version 4.0.0 20050209 (experimental) (i686-pc-cygwin)
compiled by GNU C version 4.0.0 20050131 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
as -o /cygdrive/c/DOCUME~1/PAULTH~1/LOCALS~1/Temp/ccK4DcrJ.o /cygdrive/c/DOCUME
~1/PAULTH~1/LOCALS~1/Temp/cc1r1KUq.s
/cygdrive/d/irun/libexec/gcc/i686-pc-cygwin/4.0.0/collect2.exe -Bdynamic --dll-
search-prefix=cyg /lib/crt0.o -L/cygdrive/d/irun/lib/gcc/i686-pc-cygwin/4.0.0 -L
/cygdrive/d/irun/lib/gcc/i686-pc-cygwin/4.0.0/../../.. /cygdrive/c/DOCUME~1/PAUL
TH~1/LOCALS~1/Temp/ccK4DcrJ.o -lgfortranbegin -lgfortran -lgcc -lcygwin -luser32
-lkernel32 -ladvapi32 -lshell32 -lgcc
PaulThomas@Paul /cygdrive/d/gfortran
$ ./a
Segmentation fault (core dumped)
--
Summary: -fmax-stack-var-size=N not working for equivalence
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paulthomas2 at wanadoo dot fr
CC: gcc-bugs at gcc dot gnu dot org,pinskia at physics dot
uc dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20361