This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/33298] New: Wrong code for SPREAD on dummy arguments

This code:

      REAL X(2,3), Y(2)
      CALL SUB(X,Y)
      DO I = 1, 3
      REAL A(:,:), B(:)
      A(:,:) = SPREAD(B(:),2,SIZE(A,2))

results in:

   0.000000       0.000000    
   0.000000       0.000000    
   0.000000       0.000000    


/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
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)
 /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
-L/lib/../lib64 -L/usr/lib/../lib64
/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

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]