Re: [PATCH 1/2] split OP_BR between unconditional & conditional: OP_CBR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 18, 2017 at 9:28 AM, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> This could be corrected in several ways (like changing all
> the places wheer the first test is used, use the helper
> everywhere or never set ->cond to VOID) but the simplest
> is to simply split them in two separated instructions:
> OP_BR & OP_CBR, especailly given the fact that in most cases
> the OP_BR was first selected by a switch (opcode).

I think that change itself is fine. The implications is that all sparse
back end user will need to be updated to use CBR instead of BR.

Sparse can be compiled as a lib to link against. We might want to
have some API version for sprase to check which version of sparse
it is.  Currently there is SPARSE_VERSION but that is a macro
which does not reflect in the lib version of sparse. That is a separate
patch though.

> @@ -811,9 +811,10 @@ static int rewrite_parent_branch(struct basic_block *bb, struct basic_block *old
>                 return 0;
>
>         switch (insn->opcode) {
> +       case OP_CBR:
> +               changed |= rewrite_branch(bb, &insn->bb_false, old, new);

We can use some comment of fall though the case here.

>         case OP_BR:
>                 changed |= rewrite_branch(bb, &insn->bb_true, old, new);
> -               changed |= rewrite_branch(bb, &insn->bb_false, old, new);
>                 assert(changed);
>                 return changed;
>         case OP_SWITCH: {
> @@ -886,9 +887,10 @@ static void vrfy_children(struct basic_block *bb)
>         }
>         switch (br->opcode) {
>                 struct multijmp *jmp;
> +       case OP_CBR:
> +               vrfy_bb_in_list(br->bb_false, bb->children);

Same here.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux