[llvm-branch-commits] [flang] b1afbce - [flang] Minor fix to list-directed REAL output editing

peter klausler via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 15 13:09:21 PST 2020


Author: peter klausler
Date: 2020-12-15T13:04:44-08:00
New Revision: b1afbceb9296a9ce14a0bd38f36e93b8c77fa18a

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

LOG: [flang] Minor fix to list-directed REAL output editing

Always emit the letter 'E' in list-directed REAL output;
the library was omitting it for exponents greater than 99,
as should be done for E and D formatting of large exponents
without an Ed exponent digit count.

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

Added: 
    

Modified: 
    flang/runtime/edit-output.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/edit-output.cpp b/flang/runtime/edit-output.cpp
index 31ba9f152d74..76f24cb07437 100644
--- a/flang/runtime/edit-output.cpp
+++ b/flang/runtime/edit-output.cpp
@@ -116,7 +116,7 @@ const char *RealOutputEditingBase::FormatExponent(
     }
   }
   *--exponent = expo < 0 ? '-' : '+';
-  if (edit.expoDigits || exponent + 3 == eEnd) {
+  if (edit.expoDigits || edit.IsListDirected() || exponent + 3 == eEnd) {
     *--exponent = edit.descriptor == 'D' ? 'D' : 'E'; // not 'G'
   }
   length = eEnd - exponent;


        


More information about the llvm-branch-commits mailing list