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]

gfortran.dg/intrinsic_product_1.f90 fails on x86_64-linux with -m32


gfortran.dg/intrinsic_product_1.f90 fails at all optimisation levels on x86_64-linux when -m32 is used:

$ cat intrinsic_product_1.f90
! { dg-do run }
! PR 35993 - some intrinsics with mask = .false. didn't set
! the whole return array for multi-dimensional arrays.
! Test case adapted from Dick Hendrickson.

program try

      call       ga3019(  1,  2,  3,  4)
      end program

      SUBROUTINE GA3019(nf1,nf2,nf3,nf4)
      INTEGER IDA(NF2,NF3)
      INTEGER IDA1(NF2,NF4,NF3)

ida1 = 3

      ida = -3
      IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, NF1 .LT. 0)  !fails
      print *, ida
      if (any(ida /= 1)) call abort

      ida = -3
      IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, .false. )    !fails
      print *, ida
      if (any(ida /= 1)) call abort

ida = -3
IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, ida1 .eq. 137 ) ! works
print *, ida
if (any(ida /= 1)) call abort


END SUBROUTINE
$ vim intrinsic_product_1.f90
$ ./bin/gfortran -m64 intrinsic_product_1.f90 && ./a.out
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
$ ./bin/gfortran -m32 intrinsic_product_1.f90 && ./a.out
1 1 1 -3 -3 -3
1 1 1 -3 -3 -3
1 1 1 1 1 1


No more today, I'm going to bed.
FX


-- François-Xavier Coudert http://www.homepages.ucl.ac.uk/~uccafco/


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