This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/66867] Suboptimal code generation for atomic_compare_exchange


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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |powerpc64*-*-*, x86_64-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-09-21
                 CC|                            |amodra at gmail dot com
            Summary|Suboptimal code generation  |Suboptimal code generation
                   |for C11                     |for atomic_compare_exchange
                   |atomic_compare_exchange_str |
                   |ong_explicit()              |
     Ever confirmed|0                           |1

--- Comment #2 from Alan Modra <amodra at gmail dot com> ---
Confirmed.  Here's another related testcase showing unnecessary stack memory
writes and reads on both powerpc64le and x86_64.

int test2 (int *ptr, int value, int comparand)
{
  __atomic_compare_exchange_n (ptr, &comparand, value,
                               false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
  return comparand;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]