[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
Loading
Please sign in to comment