https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99122
--- Comment #13 from Martin Jambor <jamborm at gcc dot gnu.org> --- I think that you want to disable inlining in the case when the callee has a formal parameter which is a VLA (as opposed to a VLA actual argument of a call), probably in inline_forbidden_p. When just the caller does stupid things, IMHO it can be fixed with the patch in comment #3.