This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 90909 ("[10 Regression] call devirtualized to pure virtual")

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]