[DTrace-devel] [PATCH v4 09/10] cg: move dt_regset_xalloc for consistency
Nick Alcock
nick.alcock at oracle.com
Thu Apr 14 11:09:35 UTC 2022
On 13 Apr 2022, Kris Van Hees spake thusly:
> On Tue, Apr 12, 2022 at 11:59:08AM +0100, Nick Alcock wrote:
>> Pack it next to BPF_CALL_FUNC where possible.
>>
>> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
>> Suggested-by: Eugene Loh <eugene.loh at oracle.com>
>
> Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
>
> ... with sone small change below...
Ack!
>> @@ -4478,10 +4478,10 @@ dt_cg_subr_strtok(dt_node_t *dnp, dt_irlist_t *dlp, dt_regset_t *drp)
>> emit(dlp, BPF_MOV_REG(BPF_REG_4, reg));
>> emit(dlp, BPF_ALU64_IMM(BPF_ADD, BPF_REG_4, off));
>>
>> - dt_regset_xalloc(drp, BPF_REG_0);
>> emite(dlp, BPF_CALL_FUNC(idp->di_id), idp);
>> dt_regset_free_args(drp);
>> dt_cg_tstring_xfree(yypcb, off);
>> + dt_regset_xalloc(drp, BPF_REG_0);
>
> This hunk needs to be removed. You are moving the allocation of BPF_REG_0
> *past* the function call that clobbers it. It should stay where it is.
Augh! Mindless copy-and-paste syndrome, I fear. (I wish it was easier
for tests to spot regalloc problems, but I guess this is a problem we
share with normal compiler development.)
--
NULL && (void)
More information about the DTrace-devel
mailing list