https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99339
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The stdarg pass already performs similar analysis, see e.g. reachable_at_most_once function, because if those aren't used in loops and escape, it computes not just whether the function uses some fp or gpr args, but also how many (though, upper bound for that). For the optimization discussed here, it would need to punt also on cases like: va_start if (cond) va_arg va_arg (well, could assign the first va_arg a particular register, but not to the other one).