[PATCH] D81208: Apply fix from D81179 only from GCC < 8
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 13:18:48 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG38674030c026: Apply fix from D81179 only from GCC < 8 (authored by clementval).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81208/new/
https://reviews.llvm.org/D81208
Files:
flang/include/flang/Evaluate/integer.h
flang/lib/Decimal/big-radix-floating-point.h
Index: flang/lib/Decimal/big-radix-floating-point.h
===================================================================
--- flang/lib/Decimal/big-radix-floating-point.h
+++ flang/lib/Decimal/big-radix-floating-point.h
@@ -179,10 +179,13 @@
if (remove >= digits_) {
digits_ = 0;
} else if (remove > 0) {
+#if defined __GNUC__ && __GNUC__ < 8
// (&& j + remove < maxDigits) was added to avoid GCC < 8 build failure
- // on -Werror=array-bounds
- for (int j{ 0 }; j + remove < digits_ && (j + remove < maxDigits);
- ++j) {
+ // on -Werror=array-bounds. This can be removed if -Werror is disable.
+ for (int j{0}; j + remove < digits_ && (j + remove < maxDigits); ++j) {
+#else
+ for (int j{0}; j + remove < digits_; ++j) {
+#endif
digit_[j] = digit_[j + remove];
}
digits_ -= remove;
Index: flang/include/flang/Evaluate/integer.h
===================================================================
--- flang/include/flang/Evaluate/integer.h
+++ flang/include/flang/Evaluate/integer.h
@@ -805,9 +805,13 @@
if (Part ypart{y.LEPart(k)}) {
BigPart xy{xpart};
xy *= ypart;
- // && to < (2 * parts) was added to avoid GCC < 8 build failure
- // on -Werror=array-bounds
- for (int to{ j + k }; xy != 0 && to < (2 * parts); ++to) {
+#if defined __GNUC__ && __GNUC__ < 8
+ // && to < (2 * parts) was added to avoid GCC < 8 build failure on
+ // -Werror=array-bounds. This can be removed if -Werror is disable.
+ for (int to{j + k}; xy != 0 && to < (2 * parts); ++to) {
+#else
+ for (int to{j + k}; xy != 0; ++to) {
+#endif
xy += product[to];
product[to] = xy & partMask;
xy >>= partBits;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81208.269335.patch
Type: text/x-patch
Size: 1843 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/e314f0c1/attachment.bin>
More information about the llvm-commits
mailing list