[Bug middle-end/66867] Suboptimal code generation for atomic_compare_exchange

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 21 16:38:00 GMT 2016


Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 38740
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38740&action=edit

WIP untested patch using the same technique as we use for __builtin_*_overflow*
builtins.  I'll need to still finish writing the expansion for the case when we
should expand it to external calls, once that is tested disable the ifn folding
for !flag_inline_atomics, fix up -fsanitize=threads, use for other spots that
look at atomic builtins.
And, we need some optimization that would optimize the case where REALPART_EXPR
is conditionally stored into a non-addressable var - we can store the oldval
there unconditionally then, because it can't create a race.

More information about the Gcc-bugs mailing list