https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88304

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'll fix the tree-nested.c issue, but I'm wondering about the clobber.  E.g.
for
module pr88304
  implicit none
  type t
    integer :: b = -1
    integer :: c = 2
  end type t
contains
  subroutine f1 (x)
    integer, intent(out) :: x
    x = 5
  end subroutine f1
  subroutine f4 (x)
    integer, intent(in) :: x
  end subroutine f4
  subroutine f2 ()
    type(t) :: x
    call f3
    if (x%b .ne. 5) stop 1
  contains
    subroutine f3
      call f1 (x%b)
    end subroutine f3
    subroutine f5
      call f4 (x%b)
    end subroutine f5
  end subroutine f2
end module pr88304

the clobber at the beginning of f3 doesn't make sense to me:
f3 ()
{
  x = {CLOBBER};
  _1 = &x.b;
  f1 (_1);
}
Does the fact that you call f1 (x%b) and f1's argument is intent(in) clobber
the whole type, including x%c?  I'd expect only x%b to be clobbered.

Or consider:
module pr88304
  implicit none
  type t
    integer :: b = -1
    integer :: c = 2
  end type t
contains
  subroutine f1 (x)
    integer, intent(out) :: x
    x = 5
  end subroutine f1
  subroutine f2 ()
    type(t) :: x
    call f1 (x%b)
    if (x%b .ne. 5 .or. x%c .ne. 2) stop 1
  end subroutine f2
end module pr88304
  use pr88304
  call f2
end

This fails at -O2, is it really undefined?

Reply via email to