[flang-commits] [flang] [flang][Semantics] reject COMMON/EQUIVALENCE/derived types that do not fit in int64 (PR #219976)

David Spickett via flang-commits flang-commits at lists.llvm.org
Mon Sep 7 06:26:05 PDT 2026


DavidSpickett wrote:

When Flang is built with UBSAN, one of the new tests fails:
```
******************** TEST 'Flang :: Semantics/oversized-storage-sequence.f90' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
"/usr/bin/python3.12" /home/buildbot/workspace/arm-bbot-flang-sanitized/llvm-project/flang/test/Semantics/test_errors.py /home/buildbot/workspace/arm-bbot-flang-sanitized/llvm-project/flang/test/Semantics/oversized-storage-sequence.f90 /home/buildbot/workspace/arm-bbot-flang-sanitized/build/bin/flang -fc1 -fintrinsic-modules-path=/home/buildbot/workspace/arm-bbot-flang-sanitized/build/lib/clang/24/finclude/flang/aarch64-unknown-linux-gnu
# executed command: /usr/bin/python3.12 /home/buildbot/workspace/arm-bbot-flang-sanitized/llvm-project/flang/test/Semantics/test_errors.py /home/buildbot/workspace/arm-bbot-flang-sanitized/llvm-project/flang/test/Semantics/oversized-storage-sequence.f90 /home/buildbot/workspace/arm-bbot-flang-sanitized/build/bin/flang -fc1 -fintrinsic-modules-path=/home/buildbot/workspace/arm-bbot-flang-sanitized/build/lib/clang/24/finclude/flang/aarch64-unknown-linux-gnu
# .---command stdout------------
# | --- 
# | +++ 
# | @@ -1 +1,14 @@
# | 
# | actual at 467: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long'
# | expect at 54: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 61: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 69: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 78: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 85: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 92: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 100: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 107: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 112: The size of derived type 't' exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 118: The size of derived type 'padded' exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 132: The size of the storage sequence created by EQUIVALENCE with 'c' exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 142: The size of the storage sequence created by EQUIVALENCE with 'oversized' exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 151: The size of the storage sequence created by EQUIVALENCE with 'a' exceeds the maximum supported size of 9223372036854775807 bytes
# | expect at 171: The size of COMMON block /blk/ exceeds the maximum supported size of 9223372036854775807 bytes
# | 
# | FAIL
# `-----------------------------
# error: command failed with exit status: 1
--
```
You can do this by adding `-DLLVM_USE_SANITIZER="Undefined"` to the config. check-flang will reproduce it.

https://github.com/llvm/llvm-project/pull/219976


More information about the flang-commits mailing list