llvm/flang/runtime
Peter Steinfeld 9df99d8ac2 [flang] Fix MAXLOC/MINLOC when MASK is scalar .FALSE.
When passing a scalar .FALSE. as the MASK argument to MAXLOC, we were getting
bad memory references.  We were falling into the code intended when the MASK
argument was missing.

I fixed this by checking for a scalar MASK with a .FALSE. value and
setting the result to all zeroes in that case.  I also added tests for
MAXLOC and MINLOC with scalar values of .TRUE. and .FALSE. for the MASK
argument.

I also special cased situations where the MASK argument is a scalar with
a .TRUE. value and passed along a nullptr in such cases.

Along the way, I eliminated the unused "chars" argument from the constructor
for ExtremumLocAccumulator.

Differential Revision: https://reviews.llvm.org/D124484
2022-04-27 14:50:00 -07:00
..
FortranMain [flang][driver] Add support for generating executables 2022-04-25 12:00:23 +00:00
allocatable.cpp
assign.cpp
buffer.cpp
buffer.h
character.cpp
CMakeLists.txt [flang][driver] Add support for generating executables 2022-04-25 12:00:23 +00:00
command.cpp Fix invalid overflow check in flang 2022-03-30 16:47:33 +02:00
complex-reduction.c
complex-reduction.h
config.h.cmake
connection.cpp [flang] Honor RECL= in list-directed/namelist output 2022-03-02 12:07:18 -08:00
connection.h [flang] Always encode multi-byte output in UTF-8 2022-04-14 11:13:51 -07:00
copy.cpp
copy.h
derived-api.cpp
derived.cpp [flang] Fix extent computation in finalization 2022-03-09 09:01:02 -08:00
derived.h
descriptor-io.cpp
descriptor-io.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
descriptor.cpp [flang][runtime] Ensure PointerDeallocate actually deallocate pointers 2022-03-28 10:22:08 +02:00
dot-product.cpp
edit-input.cpp [flang][runtime] Fix edge-case FP input bugs 2022-04-22 16:12:04 -07:00
edit-input.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
edit-output.cpp [flang][runtime] Enforce some limits on kP scale factors 2022-04-22 16:51:36 -07:00
edit-output.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
environment.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
environment.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
extensions.cpp
extrema.cpp [flang] Fix MAXLOC/MINLOC when MASK is scalar .FALSE. 2022-04-27 14:50:00 -07:00
file.cpp
file.h
findloc.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
format-implementation.h [flang] Extension: don't require commas between most edit descriptors in formats 2022-03-01 15:15:59 -08:00
format.cpp
format.h
inquiry.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
internal-unit.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
internal-unit.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
io-api.cpp [flang] add a static assert in CheckUnitNumberInRangeImpl 2022-04-11 09:32:52 +02:00
io-error.cpp [flang] Error recovery improvement in runtime (IOMSG=) 2022-03-18 17:24:32 -07:00
io-error.h [flang] Error recovery improvement in runtime (IOMSG=) 2022-03-18 17:24:32 -07:00
io-stmt.cpp [flang][runtime] Signal record read overrun when PAD='NO' 2022-04-22 16:52:05 -07:00
io-stmt.h [flang][runtime] Ignore leading spaces even in BZ mode 2022-04-22 12:27:19 -07:00
iostat.cpp [flang][runtime] Enforce some limits on kP scale factors 2022-04-22 16:51:36 -07:00
ISO_Fortran_binding.cpp [flang] LBOUND() edge case: empty dimension 2022-03-14 11:16:09 -07:00
lock.h
main.cpp
matmul.cpp
memory.cpp
misc-intrinsic.cpp
namelist.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
namelist.h
numeric.cpp
pointer.cpp [flang][runtime] Ensure PointerDeallocate actually deallocate pointers 2022-03-28 10:22:08 +02:00
product.cpp
ragged.cpp
random.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
reduction-templates.h [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
reduction.cpp [flang] Improve runtime crash messages 2022-03-12 15:15:56 -08:00
stat.cpp
stat.h
stop.cpp
sum.cpp
support.cpp
terminator.cpp
terminator.h
time-intrinsic.cpp [flang] Use full result range for clock_gettime implementation of SYSTEM_CLOCK 2022-04-14 13:01:32 -07:00
tools.cpp
tools.h [flang] Allow more concurrently open NEWUNIT= values, with recycling 2022-02-28 16:13:22 -08:00
transformational.cpp [flang] Convert RUNTIME_CHECK to better error for user errors in transformational.cpp 2022-03-18 16:52:43 -07:00
type-code.cpp [flang][runtime] Fix KIND=16 real/complex component I/O 2022-04-25 11:18:21 -07:00
type-info.cpp
type-info.h
unit-map.cpp [flang] Allow more concurrently open NEWUNIT= values, with recycling 2022-02-28 16:13:22 -08:00
unit-map.h [flang] Allow more concurrently open NEWUNIT= values, with recycling 2022-02-28 16:13:22 -08:00
unit.cpp [flang][runtime] Don't emit empty lines for bad writes 2022-04-15 20:32:32 -07:00
unit.h [flang] Respect left tab limit with Tn editing after ADVANCE='NO' 2022-04-13 21:45:53 -07:00
utf.cpp [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00
utf.h [flang] Initial UTF-8 support in runtime I/O 2022-03-22 11:48:14 -07:00