https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59394
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- If I use -Wl,--gc-sections -ffunction-sections, then all of the unused (non-static) functions are removed. Also -flto is able to optimize it too.