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] BIND(C) character argument #59881

Open
PeixinQiao opened this issue Jan 8, 2023 · 1 comment
Open

[flang] BIND(C) character argument #59881

PeixinQiao opened this issue Jan 8, 2023 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior flang Flang issues not falling into any other category

Comments

@PeixinQiao
Copy link
Contributor

Fortran 2018 18.3.5 (2) point 4: character argument with VALUE attribute.
Fortran 2018 18.3.5 (2) point 5: character argument without VALUE attribute.
Fortran 2018 18.3.5 (2) point 6: character argument with POINTER/ALLOCATABLE attribute.

Please check the discussions in https://reviews.llvm.org/D137254 for more details.

The standard mandates to use a CFI descriptor for assumed-length/deferred length. For BIND(C) scalar assumed length with a Fortran caller and callee, a CFI descriptor (fir.box) is not used as it should for now.

Semantic checks to be done:

  1. BIND(C) character argument must have length one if the argument has the VALUE attribute.
  2. BIND(C) allocatable or pointer dummy argument of type CHARACTER has deferred character length.
  3. It should be allowed for "assumed-shape, assumed-rank without the CONTIGUOUS" attribute with explicit length since it is covered by the third bullet point in (5). The latest gfortran allow this (e.g character(10) :: c2(:)) (but not scalar or explicit shape with explicit length). (quote from @jeanPerier in https://reviews.llvm.org/D137254)
@PeixinQiao PeixinQiao added the flang Flang issues not falling into any other category label Jan 8, 2023
@psteinfeld psteinfeld added the bug Indicates an unexpected problem or unintended behavior label Jun 2, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 2, 2023

@llvm/issue-subscribers-bug

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 flang Flang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

3 participants