On Wed, Nov 1, 2023 at 11:12 AM Hanke Zhang via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hi
>
> I've been working on function splits recently, and I've noticed that
> functions with va_args arguments won't be split, so why is that? I
> tried to understand the comments in the source code, but I still don't
> get the specific reason.

There was probably no pressing reason to support it.  It's
difficult (or impossible?) to split after the first .VA_ARG call
and if there's no .VA_LIST object constructed (I don't think
that's easily visible in the IL) you have to construct one to
pass to the split part, or alternatively guarantee the split part
doesn't access any of the variadic arguments.  All this
analysis isn't implemented I think, we simply give up when
the function has variadic args

> At the same time, if I do want to split functions with va_args
> arguments when it's safe to do, how do I define security here? In
> other words, how should I know that a function with va_args can be
> split? Or I can't?
>
> Thanks
> Hanke Zhang

Reply via email to