This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/55617] static constructors are not being instrumented correctly on darwin
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Feb 2013 07:31:24 +0000
- Subject: [Bug sanitizer/55617] static constructors are not being instrumented correctly on darwin
- Auto-submitted: auto-generated
- References: <bug-55617-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55617
--- Comment #30 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-01 07:31:24 UTC ---
Don't want to spend too much time on this, so just a few hints:
1) you want to store this in a vector (see vec.h)
2) rtxs are GC allocated, you don't want to copy_rtx it, but instead mark the
structure with GTY(()), mark also the vector var with GTY(()) and make it
va_gc vector (see doc/gty.texi, and grep around for GTY.*vec.*va_gc
and see how they are used
3) you want a stable sort, thus sorting on priority is not enough, you need to
also record the original position in the list and sort by priority first,
and then by original position (so that all ctors with the same position
go in the original order)
4) watch formatting, you're violating GNU Coding Conventions in several ways