public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5909] Fix handling of thunks in ipa-modref
@ 2021-12-11 19:37 Jan Hubicka
0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2021-12-11 19:37 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c87ff8758676307d4366d8a6113b04feae1861c7
commit r12-5909-gc87ff8758676307d4366d8a6113b04feae1861c7
Author: Jan Hubicka <jh@suse.cz>
Date: Sat Dec 11 20:37:18 2021 +0100
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.
Diff:
---
gcc/ipa-modref.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index 9e537b04196..55fa873e1f0 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -754,7 +754,7 @@ get_modref_function_summary (cgraph_node *func)
we don't want to return anything, even if we have summary for the target
function. */
enum availability avail;
- func = func->function_or_virtual_thunk_symbol
+ func = func->ultimate_alias_target
(&avail, current_function_decl ?
cgraph_node::get (current_function_decl) : NULL);
if (avail <= AVAIL_INTERPOSABLE)
@@ -4065,7 +4065,7 @@ ignore_edge (struct cgraph_edge *e)
if (!e->inline_failed)
return false;
enum availability avail;
- cgraph_node *callee = e->callee->function_or_virtual_thunk_symbol
+ cgraph_node *callee = e->callee->ultimate_alias_target
(&avail, e->caller);
return (avail <= AVAIL_INTERPOSABLE
@@ -4088,7 +4088,7 @@ compute_parm_map (cgraph_edge *callee_edge, vec<modref_parm_map> *parm_map)
class ipa_call_summary *es
= ipa_call_summaries->get (callee_edge);
cgraph_node *callee
- = callee_edge->callee->function_or_virtual_thunk_symbol
+ = callee_edge->callee->ultimate_alias_target
(NULL, callee_edge->caller);
caller_parms_info
@@ -4578,7 +4578,7 @@ modref_propagate_in_scc (cgraph_node *component_node)
/* Get the callee and its summary. */
enum availability avail;
- callee = callee_edge->callee->function_or_virtual_thunk_symbol
+ callee = callee_edge->callee->ultimate_alias_target
(&avail, cur);
/* It is not necessary to re-process calls outside of the
@@ -5021,7 +5021,7 @@ modref_propagate_flags_in_scc (cgraph_node *component_node)
/* Get the callee and its summary. */
enum availability avail;
- callee = callee_edge->callee->function_or_virtual_thunk_symbol
+ callee = callee_edge->callee->ultimate_alias_target
(&avail, cur);
/* It is not necessary to re-process calls outside of the
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-11 19:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-11 19:37 [gcc r12-5909] Fix handling of thunks in ipa-modref Jan Hubicka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).