Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] flang-new crashes (gfortran/regression/recursive_statement_functions.f90) #63231

Closed
k-arrows opened this issue Jun 10, 2023 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior crash Prefer [crash-on-valid] or [crash-on-invalid] flang:frontend

Comments

@k-arrows
Copy link

Crashed by the following program:
https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/recursive_statement_functions.f90

Here is the reduced program:

$ cat recursive.f90
program recursive
  integer :: i, st1, st2

  st1 (i) = st2 (i)
  st2 (i) = st1 (i)
end

In the stack dump, the contiguous part of Fortran::semantics::IsPureProcedure(Fortran::semantics::Symbol const&) is observed.

FYI (Gfortran)

$ gfortran -c recursive.f90
recursive.f90:5:12:

    5 |   st2 (i) = st1 (i)
      |            1
Error: Statement function at (1) is recursive
@EugeneZelenko EugeneZelenko added flang:frontend crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Jun 10, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 10, 2023

@llvm/issue-subscribers-flang-frontend

@psteinfeld psteinfeld added the bug Indicates an unexpected problem or unintended behavior label Jun 12, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 12, 2023

@llvm/issue-subscribers-bug

@klausler klausler self-assigned this Jun 22, 2023
@klausler
Copy link
Contributor

https://reviews.llvm.org/D153569

klausler added a commit that referenced this issue Jun 22, 2023
The predicate IsPureProcedure() crashes with infinite
recursion when presented with mutually recursive statement
functions -- an error case that should be recoverable.
Fix by adding a visited set.

Fixes bug #63231

Differential Revision: https://reviews.llvm.org/D153569
@klausler
Copy link
Contributor

Fix merged.

Chenyang-L pushed a commit to intel/llvm that referenced this issue Jul 11, 2023
The predicate IsPureProcedure() crashes with infinite
recursion when presented with mutually recursive statement
functions -- an error case that should be recoverable.
Fix by adding a visited set.

Fixes bug llvm/llvm-project#63231

Differential Revision: https://reviews.llvm.org/D153569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior crash Prefer [crash-on-valid] or [crash-on-invalid] flang:frontend
Projects
None yet
Development

No branches or pull requests

5 participants