Fix handling of thunks in ipa-modref
authorJan Hubicka <jh@suse.cz>
Sat, 11 Dec 2021 19:37:18 +0000 (20:37 +0100)
committerJan Hubicka <jh@suse.cz>
Sat, 11 Dec 2021 19:37:18 +0000 (20:37 +0100)
commitc87ff8758676307d4366d8a6113b04feae1861c7
tree1d8b2b21362da184161ac50670e3ccc9ec19fe84
parent365c7c6ac5400d88816e602f7f9aa12268ba53e3
Fix handling of thunks in ipa-modref

Thunks are not transparent for ipa-modref summary since it cares about offsets
from pointer parameters and also for virtual thunk about the read from memory
in there.  We however use function_or_virtual_thunk_symbol to get the summary
that may lead to wrong code (and does in two testsuite testcases with patch
I am working on).  This is a first aid fix that is bacportable to gcc 11.
We could easily produce summary for thunk on demand.  I will look into it
incrementally.  It is not very important since we usually inline the thunk when
we devirutalize...

Bootstrapped/regtested x86_64-linux, will commit it shortly.

gcc/ChangeLog:

2021-12-11  Jan Hubicka  <hubicka@ucw.cz>

* ipa-modref.c (get_modref_function_summary): Use ultimate_alias_target.
(ignore_edge): Likewise.
(compute_parm_map): Likewise.
(modref_propagate_in_scc): Likewise.
(modref_propagate_flags_in_scc): Likewise.
gcc/ipa-modref.c