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
          Reporter: olegendo at gcc dot
  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);

        mov     #1, r14
        xchg    [r1], r14     // xchg is 32 bit
        movu.B  r14, r1

It seems a .b or .w specifier can be added to the memory operand of xchg.

Reply via email to