[flang-commits] [PATCH] D112345: [flang] Fix DOT_PRODUCT for logical

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Oct 22 14:46:47 PDT 2021


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
klausler requested review of this revision.

A build-time check in a template class instantiation was applying
a test that's meaningful only for numeric types.


https://reviews.llvm.org/D112345

Files:
  flang/runtime/dot-product.cpp


Index: flang/runtime/dot-product.cpp
===================================================================
--- flang/runtime/dot-product.cpp
+++ flang/runtime/dot-product.cpp
@@ -111,7 +111,7 @@
         if constexpr (constexpr auto resultType{
                           GetResultType(XCAT, XKIND, YCAT, YKIND)}) {
           if constexpr (resultType->first == RCAT &&
-              resultType->second <= RKIND) {
+              (resultType->second <= RKIND || RCAT == TypeCategory::Logical)) {
             return DoDotProduct<RCAT, RKIND, CppTypeFor<XCAT, XKIND>,
                 CppTypeFor<YCAT, YKIND>>(x, y, terminator);
           }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112345.381659.patch
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211022/e2724367/attachment.bin>


More information about the flang-commits mailing list