On Mon, May 10, 2010 at 8:19 PM, Matthew Fluet <span dir="ltr"><<a href="mailto:matthew.fluet@gmail.com">matthew.fluet@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> I really want to hurt whoever decided to take this idiom away. There are no<br><div class="im">
> alternatives except calling out to memcpy (or similar) via a char*. The cost<br>
> to performance for a simple endian-swap is absurd.<br>
</div>Looking at the assembly code using memcpy vs. using a union with<br>
__attribute__((__may_alias__)), they are nearly identical at all but<br>
-O0. Certainly, no explicit memcpy calls, and sometimes the code that<br>
had memcpy is compiled to a shorter assembly sequence.<br></blockquote><div>So gcc optimizes the memcpy away? Interesting/Impressive.<br></div></div>