https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87397
Bug ID: 87397 Summary: Clobbering intent(out) variables caused regression in OpenCoarrays testsuite Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jb at gcc dot gnu.org Target Milestone: --- The recent patch to clobber intent(out) variables before a call appears to cause a regression in one of the OpenCoarrays testcases. I try to build OpenCoarrays with mkdir build cd build FC=~/.local/bin/gfortran cmake -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_PREFIX_PATH=~/src/gfortran/trunk/install/ .. ❯ make [ 1%] Built target opencoarrays_mod [ 4%] Built target caf_mpi [ 7%] Built target caf_mpi_static [ 8%] Generating hello_multiverse [ 8%] Built target build_hello_multiverse [ 9%] Generating coarray_distributed_transpose /home/janne/src/gfortran/OpenCoarrays/src/tests/integration/dist_transpose/coarray_distributed_transpose.F90:97:0: 97 | program coarray_distributed_transpose | internal compiler error: in lookup_field_for_decl, at tree-nested.c:277 0xd2570d lookup_field_for_decl ../../trunk-git/gcc/tree-nested.c:277 0xd28766 convert_local_reference_stmt ../../trunk-git/gcc/tree-nested.c:2282 0x9b7f66 walk_gimple_stmt(gimple_stmt_iterator*, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:568 0x9b81a0 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:51 0x9b80d1 walk_gimple_stmt(gimple_stmt_iterator*, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:631 0x9b81a0 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:51 0x9b8061 walk_gimple_stmt(gimple_stmt_iterator*, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:595 0x9b81a0 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:51 0x9b80d1 walk_gimple_stmt(gimple_stmt_iterator*, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:631 0x9b81a0 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:51 0x9b8061 walk_gimple_stmt(gimple_stmt_iterator*, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:595 0x9b81a0 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*), walk_stmt_info*) ../../trunk-git/gcc/gimple-walk.c:51 0xd22258 walk_body ../../trunk-git/gcc/tree-nested.c:702 0xd222d5 walk_function ../../trunk-git/gcc/tree-nested.c:713 0xd222d5 walk_all_functions ../../trunk-git/gcc/tree-nested.c:778 0xd2c086 lower_nested_functions(tree_node*) ../../trunk-git/gcc/tree-nested.c:3413 0x810b00 cgraph_node::analyze() ../../trunk-git/gcc/cgraphunit.c:675 0x813f29 analyze_functions ../../trunk-git/gcc/cgraphunit.c:1122 0x815002 symbol_table::finalize_compilation_unit() ../../trunk-git/gcc/cgraphunit.c:2760 Reverting the PR 41453 clobbering patch (and the follow-up patch to fix PR 87395) allows it to continue from there. (it might of course also be a bug in the testcase, I haven't looked into it. In general I think this idea of clobbering intent(out) variables is good.)