[flang-commits] [flang] [flang][Semantics] reject COMMON/EQUIVALENCE/derived types that do not fit in int64 (PR #219976)
via flang-commits
flang-commits at lists.llvm.org
Thu Sep 3 00:52:05 PDT 2026
================
@@ -226,7 +289,8 @@ auto ComputeOffsetsHelper::Resolve(const SymbolAndOffset &dep)
return dep;
} else {
SymbolAndOffset result{Resolve(it->second)};
- result.offset += dep.offset;
+ // Preserve overflow while resolving EQUIVALENCE chains.
+ result.offset = AddSizes(result.offset, dep.offset, result.offsetOverflow);
----------------
jeanPerier wrote:
Yes and No. Yes for consistency and safety, no because in recursive calls, when dep.offsetOverflow is true, then `AddSizes(result.offset, dep.offset` also overflow in all the tests I could write.
Still better to set it, so I did it in the latest commit (or rather, I propagated the new "oversized" symbol that allows better reporting to address your other comment). Thanks for the catch.
https://github.com/llvm/llvm-project/pull/219976
More information about the flang-commits
mailing list