This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81821] New: [RX] __atomic_test_and_set overwrites adjacent memory
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Aug 2017 13:35:46 +0000
- Subject: [Bug target/81821] New: [RX] __atomic_test_and_set overwrites adjacent memory
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81821
Bug ID: 81821
Summary: [RX] __atomic_test_and_set overwrites adjacent memory
Product: gcc
Version: 7.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: olegendo at gcc dot gnu.org
Target Milestone: ---
__atomic_test_and_set is supposed to change only one byte, but on RX it wrongly
overwrites adjacent memory locations:
int test (volatile char* x)
{
return __atomic_test_and_set (x, 0);
}
__Z4testPVc:
mov #1, r14
xchg [r1], r14 // xchg is 32 bit
movu.B r14, r1
rts
It seems a .b or .w specifier can be added to the memory operand of xchg.