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

Fix in preprocessing for Flexi app #658

Merged

Conversation

kiranchandramohan
Copy link
Collaborator

The preprocessor in fortran detects 1.NE.PP_NUM as a number.
The fix uses the knowledge that a constant number can have
atmost one dot character in it. If more than one dot character
is seen then the scanning has gone too far ahead.
This fix removes PP_NUM from the number detected and allows
for substitution of PP_NUM with the defined preprocessor
value.

The preprocessor in flang detects 1.NE.PP_NUM as a number.
The fix uses the knowledge that a constant number can have
atmost one dot character in it. If more than one dot character
is seen then the scanning has gone too far ahead.
This fix removes PP_NUM from the number detected and allows
for substitution of PP_NUM with the defined preprocessor
value.
Copy link
Contributor

@gklimowicz gklimowicz left a comment

Choose a reason for hiding this comment

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

This works fine on OpenPOWER.

@kiranchandramohan
Copy link
Collaborator Author

@shivaramaarao ?

@bryanpkc
Copy link
Collaborator

This might be a stupid question, but why does the preprocessor think that 1.NE (or any $num.$ident) could be a valid number?

@gklimowicz
Copy link
Contributor

gklimowicz commented Sep 15, 2020

This might be a stupid question, but why does the preprocessor think that 1.NE (or any $num.$ident) could be a valid number?

This could be an artifact of the preprocessor being shared between the PGI Fortran and C/C++ compilers (and hex floating-point constants). It's also possible that it is there to handle kind specifiers on real constants (e.g., 1.e10_REAL64).

@kiranchandramohan
Copy link
Collaborator Author

@bryanpkc please let us know if you need further explanation or if you have concerns.

Copy link
Collaborator

@bryanpkc bryanpkc left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Collaborator

@shivaramaarao shivaramaarao left a comment

Choose a reason for hiding this comment

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

LGTM

@kiranchandramohan kiranchandramohan merged commit 667f78b into flang-compiler:master Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants