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][hlfir] fir.char_convert verification failure #64315

Closed
vzakhari opened this issue Aug 1, 2023 · 4 comments
Closed

[flang][hlfir] fir.char_convert verification failure #64315

vzakhari opened this issue Aug 1, 2023 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior crash Prefer [crash-on-valid] or [crash-on-invalid] flang:ir

Comments

@vzakhari
Copy link
Contributor

vzakhari commented Aug 1, 2023

Reproducer:

subroutine test(c,n)
  character(*,4),intent(in) :: c(:)
  integer,intent(in) :: n
  interface
     subroutine callee(c)
       character(*),intent(in) :: c(:)
     end subroutine callee
  end interface
  call show([character(n)::c])
end subroutine test

subroutine test2(x)
  integer,intent(in) :: x
  character(kind=4) :: cx
  cx = achar(x)
end subroutine test2

flang-new -flang-experimental-hlfir repro.f90:

error: loc("repro.f90":9:3): 'fir.char_convert' op operand #0 must be any reference, but got '!fir.boxchar<4>'
error: loc("repro.f90":15:3): 'fir.char_convert' op operand #0 must be any reference, but got '!hlfir.expr<!fir.char<1>>'
@vzakhari vzakhari added flang:ir crash Prefer [crash-on-valid] or [crash-on-invalid] labels Aug 1, 2023
@llvmbot
Copy link
Member

llvmbot commented Aug 1, 2023

@llvm/issue-subscribers-flang-ir

@vzakhari
Copy link
Contributor Author

vzakhari commented Aug 1, 2023

Hi @cabreraam, can you please take a look?

@psteinfeld psteinfeld added the bug Indicates an unexpected problem or unintended behavior label Aug 1, 2023
@llvmbot
Copy link
Member

llvmbot commented Aug 1, 2023

@llvm/issue-subscribers-bug

jeanPerier pushed a commit to jeanPerier/llvm-project that referenced this issue Oct 5, 2023
cabreraam added a commit to cabreraam/llvm-project that referenced this issue Oct 8, 2023
cabreraam added a commit that referenced this issue Oct 9, 2023
…7570)

As shown in #64315, there were issues when trying to lower two flavors
of Fortran code that implicitly perform `CHARACTER` conversion.
This PR addresses those issues.
@cabreraam
Copy link
Contributor

Fixed in 561fbe4

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:ir
Projects
None yet
Development

No branches or pull requests

4 participants