This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/20832] New: Segfault in SUM
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Apr 2005 15:22:57 -0000
- Subject: [Bug libfortran/20832] New: Segfault in SUM
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Segfault in libgfortran on both MinGW and i686-linux:
$ cat fc014.f90
! Original bug-report by Walt Brainerd, The Fortran Company
integer,dimension(1,1) :: mis1 = 1
logical,dimension(1,1) :: ml2 = .true.
integer,dimension(1) :: s
! s = sum(mis1,dim=1,mask=ml2) ! This line works
print *, sum(mis1,dim=1,mask=ml2)
end
$ gfc fc014.f90 && ./a.out
zsh: segmentation fault ./a.out
Here is the GDB info I could gather:
(gdb) run
Starting program: /cosmic/coudert/irun/a.out
Program received signal SIGSEGV, Segmentation fault.
*_gfortran_msum_i4 (retarray=Variable "retarray" is not available.)
at ../../../gcc/libgfortran/generated/sum_i4.c:254
254 *dest = result;
(gdb) where
#0 *_gfortran_msum_i4 (retarray=Variable "retarray" is not available.)
at ../../../gcc/libgfortran/generated/sum_i4.c:254
#1 0x080482eb in MAIN__.hot_section ()
#2 0x08048363 in main (argc=1, argv=0x1)
at ../../../gcc/libgfortran/fmain.c:18
Few observations:
. segfault is in libgfortran
. with a one-dimension array, it works
. if you don't use a mask, it works
. if you don't specify "dim=..." (that is, you sum in the whole array),
it works
. if you don't use temporaries (example with the "s=..." line), it works
--
Summary: Segfault in SUM
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20832