This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/76774] New: atomics on PPC: inconsistent widths for an _Atomic(_Bool) and for atomic_compare_exchange_strong on it
- From: "Peter.Sewell at cl dot cam.ac.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Aug 2016 11:34:46 +0000
- Subject: [Bug c/76774] New: atomics on PPC: inconsistent widths for an _Atomic(_Bool) and for atomic_compare_exchange_strong on it
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
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.