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] Initialization with DATA statement having forward reference errors with implicit none #63783

Closed
kiranchandramohan opened this issue Jul 10, 2023 · 7 comments
Assignees

Comments

@kiranchandramohan
Copy link
Contributor

Initialization with DATA statement having forward reference errors with implicit none. Error and reproducer, provided below.

Error

error: Semantic errors in pre.F
./pre.F:3:12: error: No explicit type declared for 'mess'
        DATA MESS/'RIGID BODY DEFINITION                   '/
             ^^^^

Reproducer

      subroutine sb
      implicit none
      DATA MESS/'RIGID BODY DEFINITION                   '/
      CHARACTER MESS*40
      end subroutine

Note 1: This is used in applications like OpenRadioss. https://github.com/OpenRadioss/OpenRadioss/blob/main/starter/source/model/sets/preread_rbody_set.F#L66
Note 2: Classic Flang, gfortran does not report errors

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 10, 2023

@llvm/issue-subscribers-flang-frontend

@klausler klausler self-assigned this Jul 11, 2023
@klausler
Copy link
Contributor

Fix coming shortly. Need it today?

@kiranchandramohan
Copy link
Contributor Author

Not required today itself. The OpenRadioss folks are looking forward to add flang to their CI once we enable it.

@klausler
Copy link
Contributor

Is this their last blocking bug? I have a fix that needs my usual pre-review testing process before I put it up into Phabricator, but I could expedite that if it would help them.

@kiranchandramohan
Copy link
Contributor Author

No, this is not the last blocking item. We have tand in progress. There are some huge IR files that are generated that seem to take forever to go through the compiler. Also, it needs the HLFIR and polymorphic features switched ON. Once the sequential version is fixed there are OpenMP issues as well.

@klausler
Copy link
Contributor

klausler added a commit that referenced this issue Jul 17, 2023
…ONE(TYPE)

It is not standard conforming under IMPLICIT NONE(TYPE) for a name to
appear in a DATA statement prior to its explicit type declaration,
but it is benign, supported in other compilers, and attested in real
applications.  Support it with an optional portability warning.

Fixes GitHub LLVM bug #63783.
@kiranchandramohan
Copy link
Contributor Author

Fixed by the above commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants