re PR fortran/88304 (ICE in use_pointer_in_frame, at tree-nested.c:267)

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
This commit is contained in:
Jakub Jelinek 2018-12-06 11:28:31 +01:00 committed by Jakub Jelinek
parent 6a9025a01f
commit a126d36172
4 changed files with 50 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,24 @@
! 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

View File

@ -1648,6 +1648,21 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
*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. */