Fix tramp3d PGO misoptimization
authorJan Hubicka <jh@suse.cz>
Tue, 13 Oct 2020 07:19:54 +0000 (09:19 +0200)
committerJan Hubicka <jh@suse.cz>
Tue, 13 Oct 2020 07:19:54 +0000 (09:19 +0200)
commit56cb815ba22dd2ec00fee7a38f0862bc21d1c2a9
treefce42e506c77890252363c750ace48f038d9e6ea
parent8be127cac959d0f0ca0f8f9aa311828a9ee03f24
Fix tramp3d PGO misoptimization

this patch fixes tramp3d ICE with PGO.  It has turned out to be by a misupdate
in ignore_edge I introduced in previous patch that made us to not compute
SCCs correctly with -fno-lto.

While looking for problem I proofread the sources and also fortified the
srouces for situation where we insert a summary for no good reason and noticed
a problem that early ipa-modref disabled itself in some cases.
I also noticed that param_index is treamed as uhwi while it is signed (that
wastes file space).

Bootstrapping/regtesting x86_64-linux, will commit it tomorrow if that passes.

gcc/ChangeLog:

2020-10-13  Jan Hubicka  <hubicka@ucw.cz>

PR ipa/97389
* ipa-modref.c (dump_lto_records): Fix formating of dump file.
(modref_summary::dump): Do not check loads to be non-null.
(modref_summary_lto::dump): Do not check loads to be non-null.
(merge_call_side_effects): Improve debug output.
(analyze_call): Crash when cur_summary->loads is NULL.
(analyze_function): Update.
(modref_summaries::insert): Insert only into summaries, not
optimization_summaries.
(modref_summaries::duplicate): Likewise; crash when load or sotres
are NULL.
(modref_summaries_lto::duplicate): Crash when loads or stores are NULL.
(write_modref_records): param_index is signed.
(read_modref_records): param_index is signed.
(modref_write): Crash when loads or stores are NULL.
(read_section): Compensate previous change.
(pass_modref::execute): Do not check optimization_summaries t be
non-NULL.
(ignore_edge): Fix.
(compute_parm_map): Fix formating.
(modref_propagate_in_scc): Do not expect loads/stores to be NULL.
gcc/ipa-modref.c