https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117759
Bug ID: 117759
Summary: Alpha: `_Atomic' keyword not respected for !BWX and
8-bit/16-bit stores
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: target
Assignee: macro at orcam dot me.uk
Reporter: macro at orcam dot me.uk
Target Milestone: ---
Target: alpha-*-*
Created attachment 59682
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59682&action=edit
Alpha: Respect `_Atomic' keyword for HI and QI data on !BWX
We have an issue with 8-bit/16-bit stores to `_Atomic' HI and QI data
objects producing non-BWX assembly such as:
mb
insql $17,$16,$17
ldq_u $1,0($16)
mskwl $1,$16,$1
bis $17,$1,$17
stq_u $17,0($16)
mb
for:
void
atomic_store16 (_Atomic unsigned short *p, unsigned short v)
{
*p = v;
}
where an unprotected RMW sequence does not indeed guarantee atomicity of
the access to the data object addressed. This is because Alpha machine
description does not provide `atomic_storeMODE' patterns and in their
absence the middle end assumes plain stores are atomic for data objects
whose size is up to the target's word size, which does not stand for
non-BWX Alpha hardware, where only SI and DI mode stores are atomic.