PR fortran/96890 - Wrong answer with intrinsic IALL
authorHarald Anlauf <anlauf@gmx.de>
Thu, 3 Sep 2020 18:33:14 +0000 (20:33 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 3 Sep 2020 18:33:14 +0000 (20:33 +0200)
commit8eeeecbcc17041fdfd3ccc928161ae86e7f9b456
tree03d0de302626130b582dc2597059889d8b87d245
parent753b4679bc46f6806cf45d9afc3783c6d3b63589
PR fortran/96890 - Wrong answer with intrinsic IALL

The IALL intrinsic would always return 0 when the DIM and MASK arguments
were present since the initial value of repeated BIT-AND operations was
set to 0 instead of -1.

libgfortran/ChangeLog:

* m4/iall.m4: Initial value for result should be -1.
* generated/iall_i1.c (miall_i1): Generated.
* generated/iall_i16.c (miall_i16): Likewise.
* generated/iall_i2.c (miall_i2): Likewise.
* generated/iall_i4.c (miall_i4): Likewise.
* generated/iall_i8.c (miall_i8): Likewise.

gcc/testsuite/ChangeLog:

* gfortran.dg/iall_masked.f90: New test.
gcc/testsuite/gfortran.dg/iall_masked.f90 [new file with mode: 0644]
libgfortran/generated/iall_i1.c
libgfortran/generated/iall_i16.c
libgfortran/generated/iall_i2.c
libgfortran/generated/iall_i4.c
libgfortran/generated/iall_i8.c
libgfortran/m4/iall.m4