[Top] [All Lists]

Re: [PATCH] Optimize generic get_unaligned / put_unaligned implementatio

To: Ralf Baechle <>
Subject: Re: [PATCH] Optimize generic get_unaligned / put_unaligned implementations.
From: Jeremy Fitzhardinge <>
Date: Thu, 15 Feb 2007 15:05:36 -0800
Cc: Andrew Morton <>, Atsushi Nemoto <>,,
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <> <> <>
User-agent: Thunderbird (X11/20070212)
Ralf Baechle wrote:
> Gcc info page says:
> [...]
> `packed'
>      The `packed' attribute specifies that a variable or structure field
>      should have the smallest possible alignment--one byte for a
>      variable, and one bit for a field, unless you specify a larger
>      value with the `aligned' attribute.
> [...]
> Qed?

So that the compiler has to assume that if its accessing this __packed
structure, it may be embedded unaligned within something else? And
because the pointer is cast through (void *) it isn't allowed to use
alias analysis to notice that the pointer wasn't originally (apparently)

Seems sound to me.


<Prev in Thread] Current Thread [Next in Thread>