[Bug tree-optimization/66713] atomic compare_exchange_strong creates spurious store for x86-64 at -O3

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 1 06:07:00 GMT 2015


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
           Severity|normal                      |enhancement

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is due to the cmp being done as a pointer to __atomic_compare_exchange_8
function insternally.

  cmp_ = a_2(D);
  __p2.4_5 = (long unsigned int) b_3(D);
  __atomic_compare_exchange_8 (&MEM[(struct __atomic_base *)&aptr]._M_p, &cmp_,
__p2.4_5, 0, 4, 2);


It is not going to hurt performance most of the time.



More information about the Gcc-bugs mailing list