Issue 76799
Summary Large array in COMMON (2^30 4-byte elements), assignment to element, leads to segfault at runtime.
Labels flang
Assignees
Reporter harishch4
    A very large storage sequence (2**30 x 4-byte elements) in a common block leads to segmentation fault at runtime.
The below program works fine in _gfortran,classic-flang_ and _ifort_ but fails on llvm-flang : https://godbolt.org/z/YxP7P73rq
```
Program test_storage_seq_big
 Integer, Parameter :: sz = 2**30
    Real :: x(sz)
 Common/comm/x
    Print *,sz
    x(1:2000) = 42
    x(sz-2) = -99
    Call diff
    Print '("ok")'
  Contains
    Subroutine diff
      Real :: y(sz)
      Common/comm/y
      Print '(f8.1)', y(sz-2)
    End Subroutine diff
  End Program test_storage_seq_big
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to