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

Paolo Carlini paolo.carlini@oracle.com
Fri Jun 21 19:41:00 GMT 2019


On 21/06/19 21:27, Paolo Carlini wrote:
> Hi,
> On 21/06/19 20:50, Jason Merrill wrote:
>> On 6/20/19 12:24 AM, Paolo Carlini wrote:
>>> Hi,
>>> this bug notices that the more aggressive de-virtualization check 
>>> that we have now in place (fixed c++/67184) doesn't work correctly 
>>> for the below reproducer, which involves a pure virtual: we 
>>> de-virtualize and the build fails at link-time. To cure this I 
>>> believe we simply want an additional DECL_PURE_VIRTUAL_P in the 
>>> condition.
>> I don't see why this bug would be specific to pure virtual functions, 
>> so the fix also should not be.  If S1::f is not pure virtual, I'd 
>> expect that we wrongly devirtualize to it in the same way.

By the way, if S1:.f is not pure virtual, just a virtual declaration - 
all the rest being the same - the code doesn't link: undefined 
references to vtable and typeinfo for S1. The same happens with current 
clang and icc. I don't know if this detail helps us in the short term....


More information about the Gcc-patches mailing list