[PATCH] Add gcc ARM flags -munaligned-access / -mno-unaligned-access

Renato Golin renato.golin at linaro.org
Sat Aug 17 10:27:06 PDT 2013


Hi Jeroen,

AFAIK, if you don't specify strict-align, the back-end assumes unaligned
access is ok, so the behaviour is already covered.

If you want GCC compatibility, you could just add the alias to strict
align, and a dummy option to no-strict-align?

cheers,
--renato


On 17 August 2013 09:46, Jeroen Hofstee <clang at myspectrum.nl> wrote:

> Hello,
>
> In commit [1] mstrict-align is added as a cc1 option for ARM.
> "Force all memory accesses to be aligned. (ARM only)"
>
> GCC has this flag, but only for powerpc, which states:
> "On System V.4 and embedded PowerPC systems do not (do)
> assume that unaligned memory references are handled by
> the system. "
>
> On ARM gcc supports the -munaligned-access / -mno-unaligned-access,
> flags, which I am looking for:
>
> "Enables (or disables) reading and writing of 16- and 32- bit
> values from addresses that are not 16- or 32- bit aligned.
> By default unaligned access is disabled for all pre-ARMv6
> and all ARMv6-M architectures, and enabled for all other
> architectures. If unaligned access is not enabled then
> words in packed data structures will be accessed a byte
> at a time."
>
> I am not sure if there are subtle differences between these.
> Attached patch assumes they are exactly the same and adds
> the gcc flags while preserving the cc1 as well.
>
> This patch depends on the -ffixed-r9 patch for creating the
> ARM specific group.
>
> Regards,
> Jeroen
>
> [1] http://llvm.org/viewvc/llvm-**project?view=revision&**revision=167619<http://llvm.org/viewvc/llvm-project?view=revision&revision=167619>
> [2] http://gcc.gnu.org/onlinedocs/**gcc-4.8.1/gcc/RS_002f6000-and-**
> PowerPC-Options.html#RS_**002f6000-and-PowerPC-Options<http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options>
> [3] http://gcc.gnu.org/onlinedocs/**gcc-4.8.1/gcc/ARM-Options.**
> html#ARM-Options<http://gcc.gnu.org/onlinedocs/gcc-4.8.1/gcc/ARM-Options.html#ARM-Options>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130817/4e5e3cf2/attachment.html>


More information about the cfe-commits mailing list