https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107900
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pault at gcc dot gnu.org
--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 55351
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55351&action=edit
Fix for this PR
Testcase:
! { dg-do run }
!
! Contributed by Karl Kaiser <[email protected]>
!
program test
class(*), pointer :: ptr1, ptr2(:)
integer, target :: i = 42
integer :: check = 0
! ptr1 => NULL() !This would fix the problem
associate (c => ptr1)
block
select type (d => c)
type is (integer)
stop 1
class default
check = 1
end select
end block
end associate
! Now do the same with the array version
! ptr2 => NULL() !This did not fix the problem
associate (c => ptr2)
block
select type (d => c)
type is (integer)
stop 2
class default
check = check + 10
end select
end block
end associate
if (check .ne. 11) stop 3
end program test
Regards
Paul