This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 4 Apr 2014 22:53:11 +0200
- Subject: Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too
- Authentication-results: sourceware.org; auth=none
- References: <20140328172825 dot GV19304 at virgil dot suse> <20140328204353 dot GA13368 at kam dot mff dot cuni dot cz> <20140401130015 dot GX19304 at virgil dot suse> <20140403211909 dot GE6581 at atrey dot karlin dot mff dot cuni dot cz> <20140404140004 dot GA11790 at virgil dot suse> <20140404200554 dot GC29275 at kam dot mff dot cuni dot cz> <533F15AA dot 9050405 at redhat dot com>
> On 04/04/2014 04:05 PM, Jan Hubicka wrote:
> >Ah, yes, it is what I was discussing this with Jason, but apparently the
> >discussion died out. According to his comment __cxa_pure_virtual is a
> >synonym for undefined behaviour so it may be correct to unconditionally
> >devirtualize here (changing runtime behaviour from terminate() to random method
> >call), but at the moment we don't do that. Somewhere back in my head I have
> >burned in from C++ lessons that calling pure virtual method should result in
> >terminate () call, so I am considering __cxa_pure_virtual to be legitimate call
> >target (as opposed to any non-function or __builtin_unreachable that I drop
> >from the list).
> >
> >I would be happy to change this behaviour, since there are quite few extra
> >cases where we could devirtualize well then.
>
> It's definitely undefined.
>
> 10.4/6:
>
> Member functions can be called from a constructor (or destructor) of
> an abstract class; the effect of making a virtual call (10.3) to a
> pure virtual function directly or indirectly for the object being
> created (or destroyed) from such a constructor (or destructor) is
> undefined.
OK, I will change the behaviour then, thanks!
Thanks,
Honza
>
> Jason
- References:
- Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too
- Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too
- Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too
- Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too
- Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too