[flang-commits] [flang] 2c272a4 - [flang][runtime] Fix total MAXLOC/MINLOC for non-integer data

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Apr 25 12:42:27 PDT 2022


Author: Peter Klausler
Date: 2022-04-25T12:42:20-07:00
New Revision: 2c272a4e8f9dc9acca3f15bb0327e329941dc3ff

URL: https://github.com/llvm/llvm-project/commit/2c272a4e8f9dc9acca3f15bb0327e329941dc3ff
DIFF: https://github.com/llvm/llvm-project/commit/2c272a4e8f9dc9acca3f15bb0327e329941dc3ff.diff

LOG: [flang][runtime] Fix total MAXLOC/MINLOC for non-integer data

A template argument was hard-coded as the Integer type category
rather than properly forwarding the type category of the data for
type-specific instantiations of total (no DIM=) MAXLOC and MINLOC.
This broke total MAXLOC and MINLOC reductions for real and character
data.

Differential Revision: https://reviews.llvm.org/D124303

Added: 
    

Modified: 
    flang/runtime/extrema.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/extrema.cpp b/flang/runtime/extrema.cpp
index c68caec52ea32..9eb438b31f17b 100644
--- a/flang/runtime/extrema.cpp
+++ b/flang/runtime/extrema.cpp
@@ -132,7 +132,7 @@ template <TypeCategory CAT, bool IS_MAX> struct TypedMaxOrMinLocHelper {
     void operator()(const char *intrinsic, Descriptor &result,
         const Descriptor &x, int kind, const char *source, int line,
         const Descriptor *mask, bool back) const {
-      DoMaxOrMinLoc<TypeCategory::Integer, KIND, IS_MAX, NumericCompare>(
+      DoMaxOrMinLoc<CAT, KIND, IS_MAX, NumericCompare>(
           intrinsic, result, x, kind, source, line, mask, back);
     }
   };


        


More information about the flang-commits mailing list