Skip to content

[Flang][OpenMP] Correctly handling continuation lines with Fixed Source Form Conditional Compilation Sentinels #70309

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

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

sihuan
Copy link
Contributor

@sihuan sihuan commented Oct 26, 2023

Fixes #67947

@llvmbot llvmbot added flang Flang issues not falling into any other category flang:parser labels Oct 26, 2023
@github-actions
Copy link

github-actions bot commented Oct 26, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@kiranchandramohan
Copy link
Contributor

There is a related patch #70128. Not sure whether this handles the same issue.

@sihuan
Copy link
Contributor Author

sihuan commented Oct 26, 2023

There is a related patch #70128. Not sure whether this handles the same issue.

These two patches address different issues, and applying the changes in #70128 does not resolve the issue mentioned in #67947 .

@luporl
Copy link
Contributor

luporl commented Oct 26, 2023

My understanding is that the OpenMP (5.2) specification allows Fixed Source Form Conditional Compilation Sentinels (i.e., !$, *$, c$) in continuation lines, even if there was no sentinel in the initial line, according to item 3.3.1 of the spec.
But it doesn't allow Fixed Source Form Directives (e.g., !$omp parallel) in continuation lines, according to 3.1:

Directives cannot be embedded within continued statements, and statements cannot be embedded within directives.

@luporl
Copy link
Contributor

luporl commented Oct 26, 2023

Also, please add a test for this fix and for the cases that @klausler mentioned.

…orm Conditional Compilation Sentinels is a continuation line
Copy link
Contributor

@luporl luporl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please wait for @klausler.

@sihuan sihuan requested a review from klausler October 28, 2023 04:57
@sihuan sihuan requested a review from klausler October 31, 2023 07:35
@sihuan sihuan merged commit 8b91de5 into llvm:main Nov 1, 2023
@sihuan sihuan deleted the fix-67947 branch November 1, 2023 06:35
@sihuan sihuan changed the title [Flang][OpenMP] Fix compilation error when a line with Fixed Source Form Conditional Compilation Sentinels is a continuation line [Flang][OpenMP] Correctly handling continuation lines with Fixed Source Form Conditional Compilation Sentinels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:parser flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flang][OpenMP] Compilation error when a line with Fixed Source Form Conditional Compilation Sentinels is a continuation line
5 participants