[flang-commits] [flang] [flang] Fix incorrect offset for zero-size COMMON block members. (PR #214174)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Wed Aug 5 21:12:31 PDT 2026
https://github.com/eugeneepshteyn approved this pull request.
LGTM with one request:
Please also pin the opposite direction in the same file, so a future change can't over-suppress the check for zero-size members, for example:
```fortran
! A genuine backward extension through a zero-size member must still error:
! zc0 is at offset 0, so equivalence(c8(5:8), zc0) would place c8(1) at -4.
subroutine backward
integer(8) :: i8
character(0) :: zc0
character(8) :: c8
!ERROR: 'zc0' cannot backward-extend COMMON block /blk2/ via EQUIVALENCE with 'c8'
common /blk2/ zc0, i8
equivalence (c8(5:8), zc0)
end subroutine
```
https://github.com/llvm/llvm-project/pull/214174
More information about the flang-commits
mailing list