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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to David Malcolm from comment #2)
> I like adding new functionality to -fanalyzer, but I'm afraid I don't know
> anything about Fortran output statements.  Is there a good URL for this?

The best is the Fortran 2003 standard specifications but that does not give the
interface that gfortran uses into the libgfortran library. I don't know if
there is a spec for those functions.

> 
> Is this a deadlock issue?

Yes it is a deadlock issue.

right now if you have:
```
print *, f()

contains
function f()
  integer :: f
  print *, "a"
  f = 1
end function
end
```
This will hang. The example in comment #0 is the simpliest example.

> 
> Is this something that can be handled in the front-end, or does it need
> path-sensitive analysis?

It needs path sensitive because a function call might not do another print
statement based on arguments etc.

That is:
```
print *, f(10)

contains
function f(a)
  integer :: f
  integer :: a
  if (a .ne. 10) then
    print *, "hello"
  end if
  f = a + 1
end function
end
```

works. As far as I read the restrictions in the fortran spec, it is only an
issue at runtime pathes.

Reply via email to