This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/45804] New: ARM: unnecessary sign extension
- From: "felipe.contreras at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Sep 2010 01:45:53 +0000
- Subject: [Bug c/45804] New: ARM: unnecessary sign extension
- Auto-submitted: auto-generated
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