https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101979
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- GCC is assuming __rt_init_rti_board_end only points to one function pointer (which is correct based on the C standard). You need to hide that from GCC to get the code working; Something like: fn_ptr = &__rt_init_rti_board_end; fn_ptr_end = &__rt_init_rti_end; asm("":"+r"(fn_ptr); asm("":"+r"(fn_ptr_end); for (; fn_ptr < fn_ptr_end ; fn_ptr ++) { (*fn_ptr)(); }