[Bug c/85923] invalid code generation when incrementing pointer referenced by pointer
sami.kantoluoto at embedtronics dot fi
gcc-bugzilla@gcc.gnu.org
Fri May 25 12:20:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85923
--- Comment #3 from Sami Kantoluoto <sami.kantoluoto at embedtronics dot fi> ---
When compiled with:
$ gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc -v -save-temps -Wall
-Werror -Os -c skipblk.c -o skipblk.o
The following assembly is generated:
skipblk:
@ Function supports interworking.
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
ldr r3, .L5
ldr r3, [r3]
ldr ip, [r3]
mov r3, #0
ldr r2, [r0]
str lr, [sp, #-4]!
add lr, r2, #1
.L2:
ldrb r1, [r2] @ zero_extendqisi2
ldrb r1, [ip, r1] @ zero_extendqisi2
tst r1, #8
bne .L3
mov r0, r3
ldr lr, [sp], #4
bx lr
.L3:
str lr, [r0]
add r3, r3, #1
b .L2
.L6:
.align 2
.L5:
.word _ctype_tab_ptr
r2 is never incremented.
More information about the Gcc-bugs
mailing list