diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-12-06 11:28:31 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-12-06 11:28:31 +0100 |
commit | a126d36172d336ee92f18b5c0fcf60a16690c2f0 (patch) | |
tree | 03fb22959a96145fd9a067fb30bfc92fe687b2df /gcc/tree-nested.c | |
parent | 6a9025a01fbcf15c7a39b4c7af19cbdf7def8998 (diff) | |
download | gcc-a126d36172d336ee92f18b5c0fcf60a16690c2f0.zip gcc-a126d36172d336ee92f18b5c0fcf60a16690c2f0.tar.gz gcc-a126d36172d336ee92f18b5c0fcf60a16690c2f0.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r-- | gcc/tree-nested.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index 3ab60a7..ea54246 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -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. */ |