This is the mail archive of the
mailing list for the GCC project.
Re: [C++ Patch] PR 90909 ("[10 Regression] call devirtualized to pure virtual")
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 5 Jul 2019 10:04:49 -0400
- Subject: Re: [C++ Patch] PR 90909 ("[10 Regression] call devirtualized to pure virtual")
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com>
On 7/4/19 8:56 AM, Paolo Carlini wrote:
On 27/06/19 23:19, Jason Merrill wrote:
Ah, thanks. Then perhaps we want to change the CLASSTYPE_FINAL in
build_over_call to resolves_to_fixed_type_p (arg), to also handle the
other reasons we might know the dynamic type of the argument, and
remove the related code from build_new_method_call_1?
You could avoid needing to move the conditional lower by comparing
DECL_CONTEXT (fn) and BINFO_TYPE (cand->conversion_path) rather than
parmtype and TREE_TYPE (converted_arg).
Sorry for late replying, a few days off.
Anyway, great, it looks like we are reaching a nice synthesis. I must
admit that until yesterday I hadn't noticed that Fabien dealt precisely
with using declarations in order to fix c++/11750, thus the existing
check in build_new_method_call_1 is exactly what we need. The below does
that and passes testing, in it I didn't keep the checks of DECL_VINDEX
(fn) && ! (flags & LOOKUP_NONVIRTUAL) which don't seem necessary, might
avoid function calls, though. Let me know...
Yeah, they're an optimization to avoid the calls when they aren't
necessary but I wouldn't expect that the difference is measurable. The
patch is OK, thanks.