This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/45804] New: ARM: unnecessary sign extension


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45804

           Summary: ARM: unnecessary sign extension
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: felipe.contreras@gmail.com


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:
http://article.gmane.org/gmane.comp.video.ffmpeg.cvs/33470
http://article.gmane.org/gmane.comp.video.ffmpeg.devel/106781
https://bugs.launchpad.net/gcc-linaro/+bug/634682


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]