PR fortran/88304
* tree-nested.c (convert_nonlocal_reference_stmt): Remove clobbers
for non-local automatic decls.
* gfortran.fortran-torture/compile/pr88304.f90: New test.
From-SVN: r266847
+2018-12-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/88304
+ * tree-nested.c (convert_nonlocal_reference_stmt): Remove clobbers
+ for non-local automatic decls.
+
2018-12-05 David Edelsohn <dje.gcc@gmail.com>
* config/rs6000/aix72.h (ASM_DEFAULT_SPEC): Match Power7 processor
+2018-12-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/88304
+ * gfortran.fortran-torture/compile/pr88304.f90: New test.
+
2018-12-06 Richard Biener <rguenther@suse.de>
PR middle-end/63184
--- /dev/null
+! PR fortran/88304
+
+module pr88304
+ implicit none
+ type t
+ integer :: b = -1
+ end type t
+contains
+ subroutine f1 (x, y)
+ integer, intent(out) :: x, y
+ x = 5
+ y = 6
+ end subroutine f1
+ subroutine f2 ()
+ type(t) :: x
+ integer :: y
+ call f3
+ if (x%b .ne. 5 .or. y .ne. 6) stop 1
+ contains
+ subroutine f3
+ call f1 (x%b, y)
+ end subroutine f3
+ end subroutine f2
+end module pr88304
*handled_ops_p = false;
return NULL_TREE;
+ case GIMPLE_ASSIGN:
+ if (gimple_clobber_p (stmt))
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ if (DECL_P (lhs)
+ && !(TREE_STATIC (lhs) || DECL_EXTERNAL (lhs))
+ && decl_function_context (lhs) != info->context)
+ {
+ gsi_replace (gsi, gimple_build_nop (), true);
+ break;
+ }
+ }
+ *handled_ops_p = false;
+ return NULL_TREE;
+
default:
/* For every other statement that we are not interested in
handling here, let the walker traverse the operands. */