http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55617
--- Comment #36 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-02 08:46:55 UTC --- } ctor_record; Why? }; should be enough IMHO in C++. Or does GTY still require it? int ctor_index = -1; ... ctor_index++ What is this for? Just use vec_safe_length (ctors) instead. int sort_ctor_records (const void * a, const void * b) Wrong formatting: static int sort_ctor_records (const void *a, const void *b) ctor_recA etc. names are just too ugly, use ca and cb instead? void finalize_ctors() { Again, wrong formatting: static void finalize_ctors () { if (ctors->length() > 1) { ctors->qsort (sort_ctor_records); ctors->qsort (sort_ctor_records); } Just use if (vec_safe_length (ctors) > 1) { ctors->qsort (sort_ctor_records); otherwise it might crash if ctors is still NULL. Also, you don't need two qsort calls. vec_free is probably useless that late in the compilation process, I doubt there is any GC collection after that point, but not wrong. if (ctors) finalize_ctors(); This should be if (!vec_safe_is_empty (ctors))