https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71083
Bernd Edlinger <bernd.edlinger at hotmail dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bernd.edlinger at hotmail dot de --- Comment #6 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- just wanted to add that the patch in comment#2 does not fix this similar test case: struct lock_chain { char x; unsigned short base; } __attribute((packed)); struct lock_chain * foo (struct lock_chain *chain) { int i; for (i = 0; i < 100; i++) { chain[i+1].base = chain[i].base; } return chain; } foo: @ Function supports interworking. @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. ldrh r2, [r0, #1] <- unaligned add r1, r0, #300 and ip, r2, #255 add r1, r1, #3 lsr r2, r2, #8 add r3, r0, #3 .L2: strb ip, [r3, #1] strb r2, [r3, #2] add r3, r3, #3 cmp r3, r1 bne .L2 bx lr