With a cross compiler: $ ./xg++ -B. /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/abi/nvptx-nrv1.C -fno-early-inlining -Os during IPA pass: inline /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/abi/nvptx-nrv1.C:68:1: internal compiler error: in estimate_edge_growth, at ipa-inline.h:86 } ^ 0xee24ee estimate_edge_growth ../../gcc/ipa-inline.h:85 0xee2f2f estimate_size_after_inlining(cgraph_node*, cgraph_edge*) ../../gcc/ipa-inline-analysis.c:300 0x19bc15b caller_growth_limits ../../gcc/ipa-inline.c:186 0x19bc94e can_inline_edge_p ../../gcc/ipa-inline.c:383 0x19bfc81 update_caller_keys ../../gcc/ipa-inline.c:1344 0x19c1cb2 inline_small_functions ../../gcc/ipa-inline.c:2047 0x19c3168 ipa_inline ../../gcc/ipa-inline.c:2438 0x19c3e44 execute ../../gcc/ipa-inline.c:2847
Also started with r250048.
Created attachment 41977 [details] Tested patch candidate Adding patch candidate that adds: !opt_for_fn (edge->caller->decl, optimize)) to estimate_edge_growth. That's need because the mentioned revision introduced: FOR_EACH_DEFINED_FUNCTION (node) if (!node->alias && (flag_generate_lto || flag_generate_offload|| flag_wpa || opt_for_fn (node->decl, optimize))) inline_analyze_function (node); which does not calculate ipa_call_summaries->get (edge)->call_stmt_size. With the patch applied, no other inlining happens as inline_small_functions skips functions w/o optimize option.
Created attachment 41978 [details] Tested patch candidate Adding patch candidate that changes cgraph_node::verify_node that verifies global.inlined_to && same_comdat_group. It believe proper fix is to verify that node should live in a same comdat group (if belongs to any).
OK, so now the tests passes when inline clone is either in no comdat group list (even if function inlined to is in one) or if the comdat groups are the same. Does it fail when we test that comdats groups are always the same? It seems iffy to allow silently both. I guess both variants are fine, but lets pick one of them. Perhaps we want only to remove node from comdat group list while inlining it. Honza
Any progress on this?
The testcase no longer reproduces and we test that there is no inline clone in same comdat group: 212982 marxin if (global.inlined_to && same_comdat_group) 186998 hubicka { 186998 hubicka error ("inline clone in same comdat group list"); 186998 hubicka error_found = true; 186998 hubicka } This address comment #3. Comment #2 was fixed by not estimating growth in this case.