[Bug c++/87373] Packed structs are not handled properly on ARM architecture even with misaligned access is enabled
umesh.kalappa0 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 21 09:28:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87373
--- Comment #3 from Umesh Kalappa <umesh.kalappa0 at gmail dot com> ---
With -O0 , i see the byte load /store like
push {r7}
sub sp, sp, #12
add r7, sp, #0
ldr r2, .L3
mov r3, r7
str r3, [r2]
ldr r3, .L3
ldr r3, [r3]
ldrb r2, [r3]
movs r2, #0
orr r2, r2, #1
strb r2, [r3]
ldrb r2, [r3, #1]
movs r2, #0
orr r2, r2, #4
strb r2, [r3, #1]
ldrb r2, [r3, #2]
movs r2, #0
strb r2, [r3, #2]
ldrb r2, [r3, #3]
movs r2, #0
strb r2, [r3, #3]
ldr r3, .L3
ldr r3, [r3]
ldr r2, [r3] @ unaligned
ldr r3, .L3
ldr r3, [r3]
uxtb r2, r2
strb r2, [r3, #4]
ldr r3, .L3
ldr r3, [r3]
ldrb r3, [r3, #4] @ zero_extendqisi2
mov r0, r3
adds r7, r7, #12
mov sp, r7
@ sp needed
pop {r7}
bx lr
but ,why you are compiling with -O0 , any reason such ?
More information about the Gcc-bugs
mailing list