https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106338
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I don't see how this is an issue static chain is only used for nested functions in gcc and always local functions (except maybe with LTO).