https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114245
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #4) > Updating the vtable is necessary during destruction if a later (i.e. less > derived) destructor calls a virtual function. But if we can tell that the > current dtor and all later base dtors are trivial, then we know that can't > happen. > > If the front end detected that case, we wouldn't need to rely on dead store > elimination. But isn't that just an optimization the user asked not to perform (with using -O0)? I mean, e.g. the user could care about the vtable updates for e.g. calling methods from the debugger as the destruction of the object progresses.