-
Notifications
You must be signed in to change notification settings - Fork 137
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 semantic analysis failures of LBOUND/UBOUND in type specification #1422
Fix semantic analysis failures of LBOUND/UBOUND in type specification #1422
Conversation
41531d0
to
105e9e9
Compare
There are typos and format errors in your commit message; please reword it. It should start with a commit title, with a topic prefix, and separated from the message body with a blank line. For example:
|
105e9e9
to
04075d1
Compare
@bryanpkc Thanks for your comments, I have updated the commit message. |
04075d1
to
e5a9289
Compare
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.
I can give you a tentative approval. This is an extensive change where it would be difficult to prove validity of the consequences of all the possible interactions. Therefore I've hauled this commit through various flows of our CI, and it didn't break any of the workloads, also NAG tests seemed to be happy with it.
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.
This has passed our internal testing.
An issue occurs when LBOUND/UBOUND appears in the type specification of a function result and the DIM argument is missing. The root cause of this issue is that LBOUND/UBOUND is converted to runtime call in semantic phase, which is too early for type-spec of a function result. On the calling side of the function, we have no way of knowing whether LBOUND/UBOUND exists or its reference to the function's dummy arguments. We fix the issue by delaying the conversion to the tranform phase. In particular, we perform the conversion in dummy-actual argument replacement if the array argument of LBOUND/UBOUND is an assumed-shape array dummy. In addition, we fix an ICE that occurs when LBOUND/UBOUND appears in subscript expressions in type-spec, fix the link error that occurs when both DIM and KIND arguments are present, fix an issue with LBOUND on the last dimension of an assumed-size array, and add support for LBOUND/UBOUND on an assumed-rank array.
e5a9289
to
ef06245
Compare
An issue occurs when LBOUND/UBOUND appears in the type specification
of a function result and the DIM argument is missing.
The root cause of this issue is that LBOUND/UBOUND is converted to
runtime call in semantic phase, which is too early for type-spec of
a function result. On the calling side of the function, we have no
way of knowing whether LBOUND/UBOUND exists or its reference to the
function's dummy arguments.
We fix the issue by delaying the conversion to the tranform phase.
In particular, we perform the conversion in dummy-actual argument
replacement if the array argument of LBOUND/UBOUND is an assumed-shape
array dummy.
In addition, we fix an ICE that occurs when LBOUND/UBOUND appears in
subscript expressions in type-spec, fix the link error that occurs
when both DIM and KIND arguments are present, fix an issue with LBOUND
on the last dimension of an assumed-size array, and add support for
LBOUND/UBOUND on an assumed-rank array.