https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70857
Thomas Schwinge <tschwinge at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |openacc CC| |tschwinge at gcc dot gnu.org, | |vries at gcc dot gnu.org --- Comment #3 from Thomas Schwinge <tschwinge at gcc dot gnu.org> --- I had a cursory look at this. The ICE with gcc/testsuite/gfortran.dg/gomp/gridify-1.f90 occurs for "-fopenacc -fopenmp -O1", and disappears for "-fno-openacc", or alternatively to that, also disappears if "hsa" offloading is disabled using the "-foffload" option. Backtrace: #1 0x0000000000da4d7c in insert_vi_for_tree (t=0x7ffff68d7258, vi=vi@entry=0x20b8d40) at [...]/source-gcc/gcc/tree-ssa-structalias.c:2821 #2 0x0000000000da9edb in create_function_info_for (decl=0x7ffff6a8ed20, name=0x7ffff6a946c0 "vector_square_._omp_fn.0", add_id=add_id@entry=false, nonlocal_p=nonlocal_p@entry=false) at [...]/source-gcc/gcc/tree-ssa-structalias.c:5686 #3 0x0000000000daf7c9 in ipa_pta_execute () at [...]/source-gcc/gcc/tree-ssa-structalias.c:7703 #4 0x0000000000db0a62 in (anonymous namespace)::pass_ipa_pta::execute (this=0x1fa35e0) at [...]/source-gcc/gcc/tree-ssa-structalias.c:8041 #5 0x0000000000afdd3d in execute_one_pass (pass=pass@entry=0x1fa35e0) at [...]/source-gcc/gcc/passes.c:2344 #6 0x0000000000afeac2 in execute_ipa_pass_list (pass=0x1fa35e0) at [...]/source-gcc/gcc/passes.c:2774 #7 0x0000000000afeaee in execute_ipa_pass_list (pass=0x1fa3580) at [...]/source-gcc/gcc/passes.c:2786 #8 0x00000000007e3805 in ipa_passes () at [...]/source-gcc/gcc/cgraphunit.c:2266 #9 symbol_table::compile (this=this@entry=0x7ffff68d10a8) at [...]/source-gcc/gcc/cgraphunit.c:2405 #10 0x00000000007e5b9a in symbol_table::finalize_compilation_unit (this=0x7ffff68d10a8) at [...]/source-gcc/gcc/cgraphunit.c:2565 #11 0x0000000000bc3a8a in compile_file () at [...]/source-gcc/gcc/toplev.c:488 #12 0x00000000005fd99d in do_compile () at [...]/source-gcc/gcc/toplev.c:1987 #13 toplev::main (this=this@entry=0x7fffffffcd60, argc=argc@entry=27, argv=argv@entry=0x7fffffffce68) at [...]/source-gcc/gcc/toplev.c:2095 #14 0x00000000005ff4d7 in main (argc=27, argv=0x7fffffffce68) at [...]/source-gcc/gcc/main.c:39 This is the first pass_ipa_pta, run within pass_ipa_oacc, if "-fopenacc" is in effect. (That is required for OpenACC kernels processing; Tom CCed for your information.) (gdb) break insert_vi_for_tree Breakpoint 4 at 0xd94660: file [...]/source-gcc/gcc/tree-ssa-structalias.c, line 2817. (gdb) c Continuing. Breakpoint 4, insert_vi_for_tree (t=0x7ffff6aa50e0, vi=0x2091340) Breakpoint 4, insert_vi_for_tree (t=0x7ffff68d7258, vi=0x2091430) Breakpoint 4, insert_vi_for_tree (t=0x7ffff6a7f680, vi=0x2091480) Breakpoint 4, insert_vi_for_tree (t=0x7ffff6a8ee00, vi=0x20914d0) Breakpoint 4, insert_vi_for_tree (t=0x7ffff68d72d0, vi=0x20915c0) Breakpoint 4, insert_vi_for_tree (t=0x7ffff6a7f500, vi=0x2091610) Breakpoint 4, insert_vi_for_tree (t=0x7ffff6a8ed20, vi=0x2091660) Breakpoint 4, insert_vi_for_tree (t=0x7ffff68d7258, vi=0x2091750) That is, unexpectedly, the same "t" that we've already seen in the second hit of that breakpoint, and thus the second gcc_assert will trigger: /* Map from trees to variable infos. */ static hash_map<tree, varinfo_t> *vi_for_tree; [...] /* Insert ID as the variable id for tree T in the vi_for_tree map. */ static void insert_vi_for_tree (tree t, varinfo_t vi) { gcc_assert (vi); gcc_assert (!vi_for_tree->put (t, vi)); } (gdb) call debug_tree(t) <result_decl 0x7ffff68d7258 D.3465 type <void_type 0x7ffff68e6150 void VOID align 8 symtab 0 alias set -1 canonical type 0x7ffff68e6150 pointer_to_this <pointer_type 0x7ffff68e62a0>> ignored VOID file source-gcc/gcc/testsuite/gfortran.dg/gomp/gridify-1.f90 line 7 col 0 align 8 context <function_decl 0x7ffff6a8ed20 vector_square_._omp_fn.0>>