https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56550
Christophe Lyon <clyon at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clyon at gcc dot gnu.org Target| |arm --- Comment #1 from Christophe Lyon <clyon at gcc dot gnu.org> --- With today's trunk, the generated code with -mcpu=cortex-m3 -mthumb is: main: @ args = 0, pretend = 0, frame = 8 @ frame_needed = 1, uses_anonymous_args = 0 @ link register save eliminated. push {r7} sub sp, sp, #12 add r7, sp, #0 mvn r3, #254 str r3, [r7, #4] ldr r3, [r7, #4] ldr r2, .L3 str r3, [r2, #7] @ unaligned movs r3, #0 mov r0, r3 adds r7, r7, #12 mov sp, r7 @ sp needed ldr r7, [sp], #4 bx lr Since cortex-m3 supports unaligned accesses, the use of str r3, [r2, #7] @ unaligned looks OK