[Bug target/71153] aarch64 LSE __atomic_fetch_and() generates inversion for constants

ktkachov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 17 15:00:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71153

--- Comment #6 from ktkachov at gcc dot gnu.org ---
(In reply to ktkachov from comment #5)
> In the foo_clear_bit_unlock case combine tries to match:
> (parallel [
>         (set (mem/v:DI (reg:DI 88) [-1  S8 A64])
>             (unspec_volatile:DI [
>                     (and:DI (not:DI (reg:DI 85 [ mask ]))
>                         (mem/v:DI (reg:DI 88) [-1  S8 A64]))
>                     (const_int 3 [0x3])
>                 ] UNSPECV_ATOMIC_OP))
>         (clobber (scratch:DI))
>     ])
> 
> which are exactly the semantics of ldclrl but our patterns don't match that

But adding a pattern for that to atomics.md doesn't work because the MEM rtx
here is volatile and combine performs recog after initialising with
init_recog_no_volatile ().
Changing that call to just init_recog () in combine_instructions allows this to
recognise (but is, of course, not the right way to do this)


More information about the Gcc-bugs mailing list