[Bug tree-optimization/55177] missed optimizations with __builtin_bswap
dwmw2 at infradead dot org
gcc-bugzilla@gcc.gnu.org
Fri Jan 23 13:51:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55177
--- Comment #15 from David Woodhouse <dwmw2 at infradead dot org> ---
More missed optimistions (gcc version 4.9.2 20141101 (Red Hat 4.9.2-1) (GCC))
I see it using movbe for the pointer_abuse() function, but can't see a simple
way to make it use movbe *without* killing kittens.
gcc -march=atom -O2 -x c -o - -S - -Wstrict-aliasing <<EOF
struct pkt {
unsigned char data[10];
};
unsigned or(struct pkt *p)
{
return (p->data[0] << 24) | (p->data[1] << 16) | (p->data[2] << 8) |
p->data[1];
}
unsigned add(struct pkt *p)
{
return (p->data[0] << 24) + (p->data[1] << 16) + (p->data[2] << 8) +
p->data[1];
}
unsigned pointer_abuse(struct pkt *p)
{
return __builtin_bswap32(*(unsigned *)p->data);
}
EOF
More information about the Gcc-bugs
mailing list