-
Notifications
You must be signed in to change notification settings - Fork 141
Fix error of processing entry statement. #1036
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 error of processing entry statement. #1036
Conversation
|
Thanks for the patch @yaoliu-hnc and describing the problem also. |
SouraVX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to update/document the changes wherever needed ?
pawosm-arm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some more rationale in the commit message would be helpful, otherwise it looks OK.
|
ping @SouraVX |
* Compiling error when return type of entry is complex/pointer. Main cause of this problem is that flang2 checks whether the return variable is used as a dummy argument only at the first entry point, so this patch fixes the problem by going through all entry points. In addition, because flang1 changes the storage class of a pointer dummy argument from `SC_DUMMY` to `SC_BASED`, this patch modifies the check for dummy argument in flang2 accordingly. * Inconsistent with Fortran 2008 standard, ISO/IEC JTC 1/SC 22/WG 5/N1830 section-12.6.2.6 (If the characteristics of the result of the function named in the ENTRY statement are the same as the characteristics of the result of the function named in the FUNCTION statement, their result variables identify the same variable, although their names need not be the same). Flang1 currently doesn’t handle functions that are converted to subroutines as the standard specifies, and all entry points simply use the same symbol for the return variable in the field `FVAL`. This patch takes into account all the symbols associated with the return variable, and performs symbol replacement in both the dummy argument list and the AST table.
bryanpkc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
@shivaramaarao If you are okay with this PR, please merge. |
shivaramaarao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
This commit causes 3 of the NAG suite test cases to fail: sc7a sr3 sr3e |
This reverts commit 1fbbb03.
…compiler#1137). When the entry returns adjustable length character without POINTER attribute, the field NEWARG of the return variable is not set which causes that the return variable in dummy arguments is not replaced. This commit adds the check for the field NEWARG to fix the regression.
This reverts commit 1fbbb03.
…piler#1036)"" This reverts commit 4233eb3.
…compiler#1137). When the entry returns adjustable length character without POINTER attribute, the field NEWARG of the return variable is not set which causes that the return variable in dummy arguments is not replaced, and it was forgetten to replace the symbol referred in the field CVLEN. This commit fixes the previous two problems and adds the corresponding test cases.
…compiler#1137). When the entry returns adjustable length character without POINTER attribute, the field NEWARG of the return variable is not set which causes that the return variable in dummy arguments is not replaced, and the field CVLEN of the return variable also needs to be replaced.
…compiler#1137). When the entry returns adjustable length character without POINTER attribute, the field NEWARG of the return variable is not set which causes that the return variable in dummy arguments is not replaced, and the field CVLEN of the return variable also needs to be replaced.
When the entry returns adjustable length character without POINTER attribute, the field NEWARG of the return variable is not set which causes that the return variable in dummy arguments is not replaced, and the field CVLEN of the return variable also needs to be replaced.
Fix error of processing entry statement:
Compiling error when return type of entry is complex/pointer/array.
Inconsistent with Fortran 2008 standard, ISO/IEC JTC 1/SC 22/WG 5/N1830
section-12.6.2.6 (If the characteristics of the result of the function
named in the ENTRY statement are the same as the characteristics of the
result of the function named in the FUNCTION statement, their result
variables identify the same variable, although their names need not be
the same).