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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-01-06
     Ever confirmed|0                           |1
          Component|middle-end                  |tree-optimization

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
In the scalar case we change it to be:

  _12 = (long unsigned int) current_9;
  _13 = .ATOMIC_COMPARE_EXCHANGE (&MEM[(const struct __atomic_base *)&a1]._M_i,
_12, __i2.17_11, 264, 5, 5);
  _14 = IMAGPART_EXPR <_13>;
  _15 = REALPART_EXPR <_13>;

While in the case of the struct we keep it as:

  _20 = __atomic_compare_exchange_8 (&a2._M_i, &current, _12, 1, 5, 5);
  if (_20 != 0)

I wonder if we should instead just use a VCE here to get the perfomance back.

Reply via email to