[Bug ipa/87491] New: ipa_fn_summary missing for node during inlining/dumping

2018-10-02 Thread michael.ploujnikov at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87491

Bug ID: 87491
   Summary: ipa_fn_summary missing for node during
inlining/dumping
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: michael.ploujnikov at oracle dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Commit: d2c2513e2d - "Clean-up usage of ipa_fn_summary and ipa_call_summary
summaries" causes a segfault when running a test with dumping enabled:

/gcc/build/gcc/xg++ -fdump-ipa-all -dumpbase dumps 
-B/gcc/build/gcc/testsuite/g++9/../../
/gcc/src/gcc/testsuite/g++.dg/opt/pr61654.C -fno-diagnostics-show-caret
-fdiagnostics-color=never -nostdinc++
-I/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include
-I/gcc/src/libstdc++-v3/libsupc++ -I/gcc/src/libstdc++-v3/include/backward
-I/gcc/src/libstdc++-v3/testsuite/util -fmessage-length=0 -std=gnu++98 -O3  
-fno-inline-small-functions -fdump-ipa-cp
-L/gcc/build/x86_64-pc-linux-gnu/./libstdc++-v3/src/.libs
-B/gcc/build/x86_64-pc-linux-gnu/./libstdc++-v3/src/.libs
-L/gcc/build/x86_64-pc-linux-gnu/./libstdc++-v3/src/.libs
-B/gcc/build/x86_64-pc-linux-gnu/./libitm/
-L/gcc/build/x86_64-pc-linux-gnu/./libitm/.libs -lm -S -o pr61654.s

/gcc/src/gcc/testsuite/g++.dg/opt/pr61654.C:27:1: internal compiler error:
Segmentation fault
0xe866bf crash_signal
../../src/gcc/toplev.c:325
0x172b251 inline_to_all_callers_1
../../src/gcc/ipa-inline.c:2225
0x172b251 inline_to_all_callers
../../src/gcc/ipa-inline.c:2260
0xa097ce cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*,
void*), void*, bool)
../../src/gcc/cgraph.h:3213
0xa097ce cgraph_node::call_for_symbol_and_aliases_1(bool (*)(cgraph_node*,
void*), void*, bool)
../../src/gcc/cgraph.c:3744
0x172d3b9 cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*,
void*), void*, bool)
../../src/gcc/cgraph.h:3217
0x172d3b9 ipa_inline
../../src/gcc/ipa-inline.c:2580
0x172d3b9 execute
../../src/gcc/ipa-inline.c:2918


The segfault doesn't happen if I remove "-fdump-ipa-all -dumpbase dumps" from
the command.

Looks like ipa_fn_summaries doesn't have an entry for "int B::*.LTHUNK0(int,
int)" at the point of inlining because the only time it's actually added to the
map was in ipa_dump_fn_summary() before d2c2513e2d.

[Bug lto/88297] [9 Regression] Assembler Error: symbol `_Z41__static_initialization_and_destruction_0ii.constprop.0' is already defined

2018-12-03 Thread michael.ploujnikov at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88297

--- Comment #5 from michael.ploujnikov at oracle dot com ---
(In reply to Richard Biener from comment #3)
> So before the patch we were just lucky, right?  When seeing the patches I
> wondered whether we instead want to add a clone_count member to cgraph_node
> (which we could stream) and use that for the .NUM suffix.  We alread have
> it (sort-of) if we walk the clones list and do counting, right?

But the root of the problem is that multiple different cgraph_nodes share the
same name, so even if two or more nodes like that have counters == 0 we would
get the same conflict. Unless it's always the case that the additional
cgraph_nodes with the same decl name are made as copies of the original one and
their counter values are copied as well - I'm not sure if things actually work
like that, I'm just guessing...