https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78619
Bug ID: 78619 Summary: ICE in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:889 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gerhard.steinmetz.fort...@t-online.de Target Milestone: --- Invalid code affects versions 5, 6 and 7, at -Og, -Os, -O1 or higher. $ cat z1.f90 function f(x) result(z) real :: x, z z = sign(1.0, f) end $ cat z2.f90 real function f(x) result(z) real :: x z = sign(1.0, f) end $ gfortran-7-20161127 -O2 z1.f90 z1.f90:3:17: z = sign(1.0, f) 1 Warning: Non-RECURSIVE procedure 'f' at (1) is possibly calling itself recursively. Declare it RECURSIVE or use '-frecursive' z1.f90:4:0: end internal compiler error: in copy_reference_ops_from_ref, at tree-ssa-sccvn.c:889 0xe00f3b copy_reference_ops_from_ref ../../gcc/tree-ssa-sccvn.c:889 0xe02335 valueize_shared_reference_ops_from_ref ../../gcc/tree-ssa-sccvn.c:1528 0xe03aaa vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind, vn_reference_s**, bool) ../../gcc/tree-ssa-sccvn.c:2427 0xe068ad visit_reference_op_load ../../gcc/tree-ssa-sccvn.c:3557 0xe068ad visit_use ../../gcc/tree-ssa-sccvn.c:3897 0xe08e4b process_scc ../../gcc/tree-ssa-sccvn.c:4128 0xe08e4b extract_and_process_scc_for_name ../../gcc/tree-ssa-sccvn.c:4215 0xe08e4b DFS ../../gcc/tree-ssa-sccvn.c:4267 0xe096bd sccvn_dom_walker::before_dom_children(basic_block_def*) ../../gcc/tree-ssa-sccvn.c:4733 0x12f3162 dom_walker::walk(basic_block_def*) ../../gcc/domwalk.c:265 0xe0a4d2 run_scc_vn(vn_lookup_kind) ../../gcc/tree-ssa-sccvn.c:4844 0xdd9064 execute ../../gcc/tree-ssa-pre.c:5151