public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Devirtualization of objects in array
@ 2023-07-12  8:58 Ng YongXiang
  2023-07-12  9:02 ` Xi Ruoyao
  0 siblings, 1 reply; 8+ messages in thread
From: Ng YongXiang @ 2023-07-12  8:58 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

Hello,

I'm writing to seek for a review for an issue I filed some time ago.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110057 . A proposed patch is
attached in the bug tracker as well.

The gist of the issue is that in an array, we know the underlying type of
the object. An array must hold the type it is declared with, and it will
never be objects of derived type. Hence, there is a "devirtualization"
opportunity here. GCC is currently invoking the virtual destructor of the
objects in the container when the array destructs which shouldn't be the
case since we know for sure the object's type.

Thank you.

Best regards,
Yong Xiang

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-28 15:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-12  8:58 Devirtualization of objects in array Ng YongXiang
2023-07-12  9:02 ` Xi Ruoyao
2023-07-12 14:10   ` [PATCH] - Devirtualization of array destruction (C++) - 110057 Ng YongXiang
2023-07-26  4:24     ` Jason Merrill
2023-07-26 16:00       ` [PATCH] c++: devirtualization of array destruction [PR110057] Ng YongXiang
2023-07-26 16:30         ` Jason Merrill
2023-07-27  0:06           ` Ng YongXiang
2023-07-28 15:42             ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).