Commit 916bad55 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/55476 (Bogus warning "Pointer might outlive the pointer target")

2012-11-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55476
        * expr.c (gfc_check_pointer_assign): Fix check
        pointer-might-outlive-target check for host_assoc.

2012-11-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55476
        * gfortran.dg/warn_target_lifetime_3.f90: New.

From-SVN: r193872
parent ce940020
2012-11-27 Tobias Burnus <burnus@net-b.de>
PR fortran/55476
* expr.c (gfc_check_pointer_assign): Fix check
pointer-might-outlive-target check for host_assoc.
2012-11-26 Eric Botcazou <ebotcazou@adacore.com>
* trans-decl.c (gfc_finish_var_decl): Do not set DECL_RESTRICTED_P.
......
......@@ -3693,7 +3693,9 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
warn = lvalue->symtree->n.sym->attr.dummy
|| lvalue->symtree->n.sym->attr.result
|| lvalue->symtree->n.sym->attr.function
|| lvalue->symtree->n.sym->attr.host_assoc
|| (lvalue->symtree->n.sym->attr.host_assoc
&& lvalue->symtree->n.sym->ns
!= rvalue->symtree->n.sym->ns)
|| lvalue->symtree->n.sym->attr.use_assoc
|| lvalue->symtree->n.sym->attr.in_common;
......
2012-11-27 Tobias Burnus <burnus@net-b.de>
PR fortran/55476
* gfortran.dg/warn_target_lifetime_3.f90: New.
2012-11-27 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/55458
......
! { dg-do compile }
! { dg-options "-Wall" }
!
! PR fortran/55476
!
! Contribued by Janus Weil
!
subroutine test
integer, pointer :: p
integer, target :: t
p => t
contains
subroutine sub()
if (p /= 0) return
end subroutine
end subroutine
module m
integer, pointer :: p2
contains
subroutine test
integer, target :: t2
p2 => t2 ! { dg-warning "Pointer at .1. in pointer assignment might outlive the pointer target" }
contains
subroutine sub()
if (p2 /= 0) return
end subroutine
end subroutine
end module m
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment