Peter Klausler 27cf6ba1d7
[flang][runtime] Initialize uninitialized pointer components
Pointer components without default initialization pose some
difficult (or impossible) problems when they appear as right-hand
side targets in pointer assignment statements; they may contain
garbage or stale data that looks enough like a valid descriptor
to cause a crash.  Solve the problem by avoiding it -- ensure
that pointers' descriptors are at least minimally established.

Differential Revision: https://reviews.llvm.org/D149979
2023-05-08 15:08:37 -07:00

13 lines
253 B
Fortran

! RUN: %flang_fc1 -fdebug-unparse-with-symbols %s 2>&1 | FileCheck %s
! CHECK: end do
SUBROUTINE sub00(a,b,n,m)
INTEGER n,m
REAL a(n,m), b(n,m)
DO 10 j = 1,m
DO 10 i = 1,n
g = a(i,j) - b(i,j)
10 PRINT *, g
END SUBROUTINE sub00