[poky] Bad ARM code with GCC 4.7.1

Khem Raj raj.khem at gmail.com
Thu May 10 08:46:43 PDT 2012


On Thu, May 10, 2012 at 7:28 AM, Gary Thomas <gary at mlbassoc.com> wrote:
> After updating to the latest master, I'm running into trouble
> using GCC 4.7.1 with my ARM kernel(s).
>

whats your target arm architecture ? and kernel version ?

gcc generate unaligned accesses by default

Does adding -mno-unaligned-access to cflags help ?

> The problem code is in mm/percpu.c - this function [header]
>
> static void pcpu_dump_alloc_info(const char *lvl,
>                                 const struct pcpu_alloc_info *ai)
> {
>        int group_width = 1, cpu_width = 1, width;
>        char empty_str[] = "--------";
>        int alloc = 0, alloc_end = 0;
>        int group, v;
>        int upa, apl;   /* units per alloc, allocs per line */
>
> generates this code:
>
>   0xc03669d0 <pcpu_dump_alloc_info>:   ldr     r3, [pc, #532]  ; 0xc0366bec
> <pcpu_dump_alloc_info+540>
>   0xc03669d4 <pcpu_dump_alloc_info+4>: push    {r4, r5, r6, r7, r8, r9, r10,
> r11, lr}
>   0xc03669d8 <pcpu_dump_alloc_info+8>: sub     sp, sp, #52     ; 0x34
>   0xc03669dc <pcpu_dump_alloc_info+12>:        ldr     r2, [r3]
>   0xc03669e0 <pcpu_dump_alloc_info+16>:        mov     r4, r1
>   0xc03669e4 <pcpu_dump_alloc_info+20>:        mov     r10, r0
>
> which in turn generates an alignment exception at pcpu_dump_alloc_info+12



More information about the poky mailing list