| 1 |
! PR Fortran/71523 |
| 2 |
! |
| 3 |
! { dg-do compile } |
| 4 |
! { dg-options "-fdump-tree-original -finit-local-zero -fautomatic -fmax-stack-var-size=8" } |
| 5 |
! |
| 6 |
! Make sure that variables larger than max-stack-var-size which become |
| 7 |
! static are not given automatic initializers on function entry. |
| 8 |
! |
| 9 |
|
| 10 |
function set(idx, val) |
| 11 |
implicit none |
| 12 |
integer, intent(in) :: idx, val |
| 13 |
integer set |
| 14 |
integer arr(100) |
| 15 |
|
| 16 |
set = arr(idx) |
| 17 |
arr(idx) = val |
| 18 |
return |
| 19 |
end function |
| 20 |
|
| 21 |
! There should be no automatic initializer for arr |
| 22 |
! { dg-final { scan-tree-dump-times "arr = " 0 "original" } } |