Hi Richard,
Thanks so much for your comments.
在 2023/11/9 19:41, Richard Biener 写道:
> I'm not sure if the testcase is valid though?
>
> @defbuiltin{{void} __builtin_return (void *@var{result})}
> This built-in function returns the value described by @var{result} from
> the containing function. You should specify, for @var{result}, a value
> returned by @code{__builtin_apply}.
> @enddefbuiltin
>
> I don't see __builtin_apply being used here?
The prototype of the test case is from "__objc_block_forward" in
libobjc/sendmsg.c.
void *args, *res;
args = __builtin_apply_args ();
res = __objc_forward (rcv, op, args);
if (res)
__builtin_return (res);
else
...
The __builtin_apply_args puts the return values on stack by the alignment.
But the forward function can do anything and return a void* pointer.
IMHO the alignment might be broken. So I just simplified it to use a
void* pointer as the input argument of "__builtin_return" and skip
"__builtin_apply_args".
Thanks
Gui Haochen