Summary: ARM: unnecessary sign extension
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c

In the following code gcc add an unnecessary uxth operation.

static inline uint16_t read16_be(const uint8_t *p)
    uint16_t v;
    __asm__("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)p));
    __asm__("rev16 %0, %0" : "+r"(v));
    return v;

Many other people have experienced this issue:

Reply via email to