Issue 243902
Summary [flang] High memory for DATA with zero-size elements or at size limit
Labels flang
Assignees
Reporter blazie2004
    Two DATA shapes still need a lot of compiler memory. They came up in the review of #240767. The first also occurs with a build from before #216960. The second needs about six times more memory since #216960.

Zero-size elements are not stopped by the DATA size limit, because the object is 0 bytes, but the value is still expanded element by element:

```fortran
subroutine s
 type t
    character(0) c(2000000000)
  end type
  type(t) x
  data x / t('') /
end
```

`flang -fc1 -fsyntax-only` aborts with "LLVM ERROR: out of memory" after about 17 to 25 GB. An empty derived type as the element type does the same.

A DATA object of exactly 1000000000 bytes is within the limit, so its value is expanded:

```fortran
subroutine exact_limit
 type t
    real values(250000000)
  end type
  type(t) x
  data x / t(1.0) /
end
```

This peaks at about 24.5 GB on current main, compared with about 4 GB before #216960.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to