On 04/05/06 02:07, Andrew Pinski wrote:
Actually I bet ntohs16 is violating C aliasing rules.
So getting rid of GCC actually is wrong. Getting rid
of these aliasing violations is the correct way.
-- Pinski
Interesting, how do you figure that?
The relevant definition is:
#define __swap16md(x) ({ \
u_int16_t __swap16md_x = (x); \
\
__asm ("rorw $8, %w1" : "+r" (__swap16md_x)); \
__swap16md_x; \
})
i.e. a block that "returns" a short value (a "compound statement expression" is
the gcc terminology, we believe).
Where would aliasing rules enter into this situation?
Thanks for looking at this, if we can help or assist with solving this: please
don't hesitate to ask.
+++chefren