Skip to content

Conversation

@klausler
Copy link
Contributor

When an assignment to a derived type allocatable requires (re)allocation, its type may change to that of the right-hand side. The code didn't update its derived type pointer, leading to the wrong type being put into the descriptors created for elemental defined assignment subroutine calls.

Fixes #141835.

@klausler klausler changed the title [flang][runtime] Accomodate change of type in assignment to allocatable [flang][runtime] Accommodate change of type in assignment to allocatable May 29, 2025
When an assignment to a derived type allocatable requires (re)allocation,
its type may change to that of the right-hand side.  The code didn't
update its derived type pointer, leading to the wrong type being
put into the descriptors created for elemental defined assignment
subroutine calls.

Fixes llvm#141835.
Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

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

LGTM.
It fixed the test cases.
Thanks.

@klausler klausler merged commit 7b9518a into llvm:main Jun 4, 2025
9 checks passed
@klausler klausler deleted the bug141835 branch June 4, 2025 16:22
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.

[flang] Incorrect implementation sequence when the defined assignment is elemental for allocatable component.

3 participants