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

            Bug ID: 76774
           Summary: atomics on PPC: inconsistent widths for an
                    _Atomic(_Bool) and for atomic_compare_exchange_strong
                    on it
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Peter.Sewell at cl dot cam.ac.uk
  Target Milestone: ---

On a POWER 7 machine using GCC 4.9.1, something declared as an _Atomic(_Bool)
appears to generate a 1-byte object but using atomic_compare_exchange_strong on
it generates 4-byte LL/SC (lwarx/stwcx) instructions.  We observed this in two
ways:  a global 

    static _Atomic(_Bool) locked;

produces a 1-byte ELF object, and in a packed struct

    struct __attribute__((__packed__)) s {
      _Atomic(_Bool) s_locked;
      char c;
    };

the c field seems to be 1 byte after the s_locked field.

Reply via email to