https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103069
--- Comment #19 from Hongyu Wang <wwwhhhyyy333 at gmail dot com> --- (In reply to Thiago Macieira from comment #18) > (In reply to Jakub Jelinek from comment #17) > > _Pragma("GCC target \"relax-cmpxchg-loop\"") > > should do that (ditto target("relax-cmpxchg-loop") attribute). > > The attribute is applied to a function. I'm hoping to do it for s block of > code: > > _Pragma("GCC push_options") > _Pragma("GCC target \"relax-cmpxchg-loop\"") > __atomic_compare_exchange_weak(....); > _Pragma("GCC pop_options") I'm not aware of any target __attribute__ or #Pragma can be used to code block, at this level user can change their code directly, so I don't know why it is needed..