[PATCH v2] Check optab before transforming atomic bit test and operations

Hongtao Liu crazylht@gmail.com
Mon Nov 15 03:11:17 GMT 2021


On Mon, Nov 15, 2021 at 9:37 AM Hongtao Liu <crazylht@gmail.com> wrote:
>
> On Sat, Nov 13, 2021 at 2:21 AM H.J. Lu via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > On Fri, Nov 12, 2021 at 8:13 AM Jakub Jelinek <jakub@redhat.com> wrote:
> > >
> > > On Fri, Nov 12, 2021 at 07:55:26AM -0800, H.J. Lu wrote:
> > > > > I have following patch queued for testing for this...
> > > > >
> > > > > 2021-11-12  Jakub Jelinek  <jakub@redhat.com>
> > > > >
> > > > >         PR target/103205
> > > > >         * config/i386/sync.md (atomic_bit_test_and_set<mode>,
> > > > >         atomic_bit_test_and_complement<mode>,
> > > > >         atomic_bit_test_and_reset<mode>): Use OPTAB_WIDEN instead of
> > > > >         OPTAB_DIRECT.
> > > > >
> > > > >         * gcc.target/i386/pr103205.c: New test.
> > > >
> > > > Can you include my tests?  Or you can leave out your test and I can check
> > > > in my tests after your fix has been checked in.
> > >
> > > I'd prefer the latter.
> > >
> >
> > Here is the v2 patch on top of yours.
> >
> > --
> > H.J.
>
> It looks like there're many return; in if (!bit) branch, the those
> return should never be executed since they're already guarded by
> gimple_nop_atomic_bit_test_and_p, So we'd better also remove those
> return;
It looks like those return are used for  (rhs_code == BIT_AND_EXPR)
which doesn't change gimple before, so nevermind.
>
> --
> BR,
> Hongtao



-- 
BR,
Hongtao


More information about the Gcc-patches mailing list