This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Use of spread intrinsic


Hi

In the code I'm trying to compile with gfortran, I came accross
something like this:

PROGRAM ding
  IMPLICIT NONE

  PRINT*, SPREAD(1.0,1,4)

END PROGRAM ding

Running this program when compiled with gfortran goes off into an
infinite loop, while the intel fortran compiled version gives:

$ ./ding
   1.000000       1.000000       1.000000       1.000000    

If I change the code to:

  PRINT*, SPREAD((/1.0/),1,4)

both ifort and gfortran produce identical output, as above.

Is the first case an extension of some sort, or should both work?

Thanks
Neilen


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