[Bug target/64516] [4.x Regression] arm: wrong unaligned load generated

markus at oberhumer dot com gcc-bugzilla@gcc.gnu.org
Thu Feb 5 12:11:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64516

Markus F.X.J. Oberhumer <markus at oberhumer dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.3.3

--- Comment #2 from Markus F.X.J. Oberhumer <markus at oberhumer dot com> ---
This is a wrong code regression against gcc 4.3.3.

I've booted an older ARM Ubuntu box just for testing:

$ gcc -v
[...]
gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)

$ gcc -O3 -Wall -W -Wcast-align -c unaligned_load_bug.c

$ objdump -d unaligned_load_bug.o

unaligned_load_bug.o:     file format elf32-littlearm

Disassembly of section .text:

00000000 <put16_unaligned>:
   0:   e52de004        push    {lr}            ; (str lr, [sp, #-4]!)
   4:   e24dd00c        sub     sp, sp, #12     ; 0xc
   8:   e28d3008        add     r3, sp, #8      ; 0x8
   c:   e3a02002        mov     r2, #2  ; 0x2
  10:   e16310b2        strh    r1, [r3, #-2]!
  14:   e1a01003        mov     r1, r3
  18:   ebfffffe        bl      0 <memcpy>
  1c:   e28dd00c        add     sp, sp, #12     ; 0xc
  20:   e8bd8000        pop     {pc}

00000024 <get16_unaligned>:
  24:   e52de004        push    {lr}            ; (str lr, [sp, #-4]!)
  28:   e24dd00c        sub     sp, sp, #12     ; 0xc
  2c:   e1a01000        mov     r1, r0
  30:   e3a02002        mov     r2, #2  ; 0x2
  34:   e28d0006        add     r0, sp, #6      ; 0x6
  38:   ebfffffe        bl      0 <memcpy>
  3c:   e1dd00b6        ldrh    r0, [sp, #6]
  40:   e28dd00c        add     sp, sp, #12     ; 0xc
  44:   e8bd8000        pop     {pc}

00000048 <put16_aligned>:
  48:   e1c010b0        strh    r1, [r0]
  4c:   e12fff1e        bx      lr

00000050 <get16_aligned>:
  50:   e1d000b0        ldrh    r0, [r0]
  54:   e12fff1e        bx      lr



More information about the Gcc-bugs mailing list