https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
--- Comment #9 from Eyal Rozenberg ---
(In reply to Jason Merrill from comment #8)
> I think if the object were not an actual Aint, performing the standard
> conversion to A* should be undefined, allowing the devirtualization. But
> I'm not find
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
Jason Merrill changed:
What|Removed |Added
CC||jason at gcc dot gnu.org
--- Comment #8
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
--- Comment #7 from Kamlesh Kumar ---
After this patch
diff --git a/gcc/ipa-polymorphic-call.c b/gcc/ipa-polymorphic-call.c
index 705af03..b76793f 100644
--- a/gcc/ipa-polymorphic-call.c
+++ b/gcc/ipa-polymorphic-call.c
@@ -1118,6 +1118,10 @@
ip
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
--- Comment #6 from Kamlesh Kumar ---
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg01527.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
--- Comment #5 from Eyal Rozenberg ---
(In reply to Jan Hubicka from comment #3)
> The reason why we do not devirtualize is that only information about Aint is
> the type of function parameter
"Only"? :-)
> and we do not believe it implies the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
--- Comment #4 from Jan Hubicka ---
And to answer the question about why GCC produces more code, it is
actually speculative devirtualization of the call. GCC determines
the most likely target and inlines it.
foo_virtual(Aint*):
# this
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
--- Comment #3 from Jan Hubicka ---
OK, C++ FE can't do that because virtual call is wrapper by foo_virtual_inner.
After inlining we see:
Determining dynamic type for call: OBJ_TYPE_REF(_5;(struct A)p_2(D)->0)
(p_2(D), p_2(D));
Starting walk at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
Jan Hubicka changed:
What|Removed |Added
CC||jason at redhat dot com
--- Comment #2 fro
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89924
Richard Biener changed:
What|Removed |Added
Keywords||missed-optimization
Status|