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

[flang][hlfir] Fix c_null_ptr lowering in structure constructors #68321

Merged
merged 1 commit into from
Oct 6, 2023

Commits on Oct 5, 2023

  1. [flang][hlfir] Fix c_null_ptr lowering in structure constructors

    Lowering handles C_PTR initial values that are designators or NULL()
    inside structure constructors as an extension to support. This extension
    is used by initial values generated for runtime derived type info.
    
    But c_null_ptr wrongly fell into this extension path with HLFIR, causing
    the initial value to be set to some (non null) address containing c_null_ptr
    instead of c_null_ptr itself...
    
    This was caused by the FIR lowering relying on genExtAddrInInitializer
    to not place c_null_ptr inside an address. Fix this by only falling
    through into the extension handling code if this is an extension: i.e,
    the expression is some designated symbol or NULL().
    jeanPerier committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    3ec2d6c View commit details
    Browse the repository at this point in the history