[U-Boot] [PATCH v2] arm: Switch to -mno-unaligned-access when supported by the compiler
Albert ARIBAUD
albert.u.boot at aribaud.net
Tue Feb 11 18:11:11 CET 2014
Hi Måns,
On Tue, 11 Feb 2014 16:44:46 +0000, Måns Rullgård <mans at mansr.com>
wrote:
> Albert ARIBAUD <albert.u.boot at aribaud.net> writes:
>
> > Hi Måns,
> >
> > On Tue, 11 Feb 2014 15:33:09 +0000, Måns Rullgård <mans at 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.
>
> The flag does both of those things. It even gives the compiler
> permission to merge multiple adjacent accesses into a single wider one.
Both of which two things exactly?
Besides, the only place where we saw it merge adjacent accesses into a
wider one is in some cases of array initialization which are documented
in doc/README.arm-unaligned-accesses.
> >> To get the behaviour you desire, the code should be compiled with
> >> -mno-unaligned-access. This tells the compiler to _never_ automatically
> >> perform an unaligned memory access. If it thinks an address might be
> >> unaligned, it will split the access.
> >
> > This shows that you really have not read my argument, in which I *did*
> > explain why we tell the compiler *not* to split unaligned accesses into
> > smaller correctly aligned accesses, i.e., why -munaligned-access is
> > used.
>
> I have read what you call your argument. Unfortunately for you, it is
> based on false premises, and as such any conclusions you arrive at are
> incorrect.
(you have asked someone else not to be condescending. I, in turn, ask
you to stop being insulting.)
If you have read my argument, then I assume you have understood that the
point of it is to detect uncontrolled unaligned accesses; however, your
rebuttal apparently misses this point, as it proposes to *prevent*
detection of such unaligned accesses.
Amicalement,
--
Albert.
More information about the U-Boot
mailing list