[Bug fortran/103394] Bad object code for structure constructor
neil.n.carlson at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 23 23:39:07 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103394
--- Comment #1 from Neil Carlson <neil.n.carlson at gmail dot com> ---
I've experimented some more and have reduced things further to this example.
I'm not positive it captures everything that is going wrong in the original.
program example
type :: foo
end type
type :: bar
type(foo), pointer :: fptr
end type
class(foo), pointer :: f
allocate(foo :: f)
call sub(bar(f))
contains
subroutine sub(b)
type(bar), intent(in) :: b
if (.not.associated(b%fptr, f)) stop 1
end subroutine
end program
The example works correctly if "class(foo), pointer :: f" is replaced by
"type(foo), pointer :: f", so it seems pretty clear that intrinsic structure
constructor is not properly making the assignment "bar%fptr => f".
More information about the Gcc-bugs
mailing list