[U-Boot] [PATCH v2] arm: Switch to -mno-unaligned-access when supported by the compiler

Tom Rini
2014-02-12T14:35:55Z

On Tue, Feb 11, 2014 at 05:37:55PM +0100, Albert ARIBAUD wrote:
> Hi M?ns,
>
> On Tue, 11 Feb 2014 15:33:09 +0000, M?ns Rullg?rd <mans@mansr.com>
> wrote:
>
> > The problem is that the current settings do
> > the exact opposite. By using -munaligned-access by default, you are
> > asking the compiler to go ahead and do whatever it thinks is best, which
> > is sometimes to perform an intentional unaligned access. Exactly when
> > this will happen is largely impossible to predict.
>
> The -munaligned-access option does *not* "[ask] the compiler to go
> ahead and do whatever it thinks is best", it tells it to use direct
> native accesses when unaligned accesses are required, as opposed to
> splitting unaligned accesses into smaller but aligned aligned native
> accesses, which is what you get with -mno-unaligned-access.

Incorrect, and gets to the heart of our problem. It says that native
unaligned accesses are valid and make use of this as appropriate. So
our goal of "make the compiler use native unaligned accesses so we can
find bad code" is invalid. It's making properly written code fail
instead and improperly written code will still be just as improper.

--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140212/3c099406/attachment.pgp>