Skip to content

[flang][debug] Wrong signature for function returning derived types. #112902

Open
@abidh

Description

@abidh

Consider the following code

module mod
    type cart
        integer :: x1
    end type
contains
    type(cart) function build(x)
        integer :: x
        build%x1 = x
    end function
end module

program function_calls
    use mod
    implicit none
    type(cart) :: b
    b = build(4)
    print *, b
end program

This is what GDB shows for the type of the build function. Notice return type and first argument.

(gdb) ptype mod::build
type = void (Type cart, integer)

This seems to be done in AbstractResultOpt pass but debug info needs to have the function signature as it was in the source.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions