From: Mark Fortescue <[EMAIL PROTECTED]>
Date: Sat, 2 Jun 2007 19:46:21 +0100 (BST)

> Some versions of GCC may be capable of sorting out the correct code
> but my experience is avoid the situation to start with by using code
> similar to memcpy (&x, &un_aligned_x, sizeof x).

This unfortunately doesn't work, if GCC decides the object is
small enough to copy inline, it will emit 32-bit and 64-bit
load and store instructions and still therefore take the
unaligned exceptions.

Types must be aligned on their natural size, and GCC can assume
this everywhere you reference such types unless you use the
"packed" GCC attribute.
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to