This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR 45934] Devirtualization aware of dynamic type changes
On Nov 24, 2010, at 3:09 AM, Richard Guenther wrote:
> Well. I'm sort-of worried by the use of types and BINFOs by the
> devirtualization machinery in general.
It should be controlled and considered. An architect should consider the best way of doing the optimization. I think having the optimization seems reasonable.
> Also devirtualization happens in the middle-end and thus can't really
> assume it was C++ originally (ok, only ObjC seems to use OBJ_TYPE_REF
> and that in a weird way).
The shapes used by the devirtualization machinery needs to be documented in the middle end and needs to be appropriate given how C++ and Objective C use those shapes. Neither C++ nor Objective C can then change to violate the requirements of the middle end and should C++ change to not follow the shapes as documented, the optimization would just stop applying. In practice I don't see this as such a big deal.