Re: [PATCH 0/5] simplify SEL(SEL, ...), ...)

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

 



On Sat, Nov 7, 2020 at 10:38 AM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> I think there's a couple of others, like
>
>   SEL(x, x, 0) -> x
>
> which looks insane, but I think these are the kinds of things that end
> up showing up when you inline things that return errors, and then you
> test them for zero etc.

Made-up crazy example:

    extern int fn(int);

    int t(int x)
    {
        int err = fn(x);
        if (err)
                return err;
        return 0;
    }

which is the kind of thing that can happen when you have various
config options and code goes away. It *should* just result in a no-op
(ie just call 'fn()' and return its value), but currently sparse
generates

    call.32     %r2 <- fn, %arg1
    select.32   %r6 <- %r2, %r2, $0
    ret.32      %r6

instead of

    call.32     %r2 <- fn, %arg1
    ret.32      %r2

but I hadn't actually applied your patches when I did that test, so
maybe you had caught this case already without me realizing it.

           Linus



[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