This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33298] New: Wrong code for SPREAD on dummy arguments
- From: "toon at moene dot indiv dot nluug dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Sep 2007 07:20:41 -0000
- Subject: [Bug fortran/33298] New: Wrong code for SPREAD on dummy arguments
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This code:
REAL X(2,3), Y(2)
Y=[1.,2.]
CALL SUB(X,Y)
DO I = 1, 3
PRINT*,X(:,I)
ENDDO
END
SUBROUTINE SUB(A,B)
REAL A(:,:), B(:)
A(:,:) = SPREAD(B(:),2,SIZE(A,2))
END
results in:
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
using:
/usr/snp/bin/gfortran -static -v -g -O2 -fbacktrace spread.f
Driving: /usr/snp/bin/gfortran -static -v -g -O2 -fbacktrace spread.f
-lgfortranbegin -lgfortran -lm
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../trunk/configure --prefix=/usr/snp/ --disable-multilib
--disable-nls --enable-languages=fortran
Thread model: posix
gcc version 4.3.0 20070903 (experimental) (GCC)
/usr/snp/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.3.0/f951 spread.f
-ffixed-form -quiet -dumpbase spread.f -mtune=generic -auxbase spread -g -O2
-version -fbacktrace -fintrinsic-modules-path
/usr/snp/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.0/finclude -o
/tmp/ccjGK59d.s
GNU F95 (GCC) version 4.3.0 20070903 (experimental) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.3.0 20070903 (experimental), GMP version
4.2.1, MPFR version 2.3.0-rc1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
as -V -Qy -o /tmp/cc53anSf.o /tmp/ccjGK59d.s
GNU assembler version 2.17.90 (x86_64-linux-gnu) using BFD version (GNU
Binutils for Debian) 2.17.90.20070812
/usr/snp/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.3.0/collect2 -m
elf_x86_64 -static /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/usr/snp/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.0/crtbeginT.o
-L/usr/snp/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.0
-L/usr/snp/bin/../lib/gcc
-L/usr/snp/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/snp/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../..
/tmp/cc53anSf.o -lgfortranbegin -lgfortran -lm --start-group -lgcc -lgcc_eh -lc
--end-group /usr/snp/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.3.0/crtend.o
/usr/lib/../lib64/crtn.o
Debian's testing gfortran-4.2 gave me another bunch of nonsense:
-4.5149084E-10 4.5916347E-41
-4.5151327E-10 4.5916347E-41
-4.5151283E-10 4.5916347E-41
Trying to print the SPREAD expression directly gave me a segmentation fault
using the above gfortran 4.2 and an empty line using 4.3.
--
Summary: Wrong code for SPREAD on dummy arguments
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: toon at moene dot indiv dot nluug dot nl
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33298