https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89651

--- Comment #5 from Jim Feng <jfeng33 at hotmail dot com> ---
(In reply to Jakub Jelinek from comment #4)
> On the other side, the testcase is invalid, because you are summing
> uninitialized data.  It is like if you did:
> program pr89651
>   integer :: n
>   real, allocatable :: t(:)
>   n = 10
>   allocate (t(n))
>   print *, sum (t)
> end program pr89651
> but it is true gfortran doesn't warn here either.  And we do warn even with
> firstprivate(t) when it is not undefined.

In the test case, the array is initialized:

allocate(t(n),source=0.0)

It is puzzling that normal compile without optimization is OK. My concern is
whether I should just disregard the warning or compile the program without
optimization.

Reply via email to