public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33298]  New: Wrong code for SPREAD on dummy arguments
@ 2007-09-04  7:20 toon at moene dot indiv dot nluug dot nl
  2007-09-04  7:49 ` [Bug fortran/33298] " jpr at csc dot fi
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: toon at moene dot indiv dot nluug dot nl @ 2007-09-04  7:20 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-09-06 21:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-04  7:20 [Bug fortran/33298] New: Wrong code for SPREAD on dummy arguments toon at moene dot indiv dot nluug dot nl
2007-09-04  7:49 ` [Bug fortran/33298] " jpr at csc dot fi
2007-09-04  7:57 ` burnus at gcc dot gnu dot org
2007-09-04  8:11 ` toon at moene dot indiv dot nluug dot nl
2007-09-04 10:15 ` [Bug fortran/33298] Wrong code for SPREAD on zero sized " toon at moene dot indiv dot nluug dot nl
2007-09-04 10:51 ` [Bug libfortran/33298] Wrong code for SPREAD on zero-sized arrays fxcoudert at gcc dot gnu dot org
2007-09-04 13:04 ` toon at moene dot indiv dot nluug dot nl
2007-09-04 21:03 ` tkoenig at gcc dot gnu dot org
2007-09-06  8:56 ` toon at moene dot indiv dot nluug dot nl
2007-09-06 11:57 ` patchapp at dberlin dot org
2007-09-06 19:26 ` tkoenig at gcc dot gnu dot org
2007-09-06 21:14 ` tkoenig at alice-dsl dot net
2007-09-06 21:23 ` tkoenig at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).