+2017-08-28 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/81770
+ * expr.c (gfc_check_pointer_assign): Improve the check whether pointer
+ may outlive pointer target.
+
2017-08-27 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/81974
if (warn_target_lifetime
&& rvalue->expr_type == EXPR_VARIABLE
&& !rvalue->symtree->n.sym->attr.save
- && !attr.pointer && !rvalue->symtree->n.sym->attr.host_assoc
+ && !rvalue->symtree->n.sym->attr.pointer && !attr.pointer
+ && !rvalue->symtree->n.sym->attr.host_assoc
&& !rvalue->symtree->n.sym->attr.in_common
&& !rvalue->symtree->n.sym->attr.use_assoc
&& !rvalue->symtree->n.sym->attr.dummy)
+2017-08-28 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/81770
+ * gfortran.dg/warn_target_lifetime_3.f90: Fix a typo.
+ * gfortran.dg/warn_target_lifetime_4.f90: New testcase.
+
2017-08-28 Steve Ellcey <sellcey@cavium.com>
* gfortran.dg/dec_init_1.f90 (dummy): Use ichar in print statement.
!
! PR fortran/55476
!
-! Contribued by Janus Weil
+! Contributed by Janus Weil
!
subroutine test
integer, pointer :: p
--- /dev/null
+! { dg-do compile }
+! { dg-options "-Wtarget-lifetime" }
+!
+! PR fortran/81770: [5/6/7 Regression] Bogus warning: Pointer in pointer assignment might outlive the pointer target
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+module m
+
+ type t
+ integer, allocatable :: l
+ end type
+
+contains
+
+ subroutine sub(c_in, list)
+ type(t), target, intent(in) :: c_in
+ integer, pointer, intent(out) :: list
+
+ type(t), pointer :: container
+
+ container => c_in
+
+ list => container%l
+
+ end subroutine
+
+end