https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85923
--- Comment #5 from Sami Kantoluoto <sami.kantoluoto at embedtronics dot fi> --- When compiled with $ gcc-arm-none-eabi-4_6-2012q4/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 @ link register save eliminated. ldr r3, .L4 str r4, [sp, #-4]! ldr r1, [r3, #0] mov r3, #0 b .L2 .L3: add r2, r2, #1 str r2, [r0, #0] add r3, r3, #1 .L2: ldr r2, [r0, #0] ldr r4, [r1, #0] ldrb ip, [r2, #0] @ zero_extendqisi2 ldrb ip, [r4, ip] @ zero_extendqisi2 tst ip, #8 bne .L3 mov r0, r3 ldmfd sp!, {r4} bx lr .L5: .align 2 .L4: .word _ctype_tab_ptr Which seems ok to me. Compiler: $ arm-none-eabi-gcc -v Using built-in specs. COLLECT_GCC=/emb/gcc-arm-none-eabi-4_6-2012q4/bin/arm-none-eabi-gcc COLLECT_LTO_WRAPPER=/work/emb/gcc-arm-none-eabi-4_6-2012q4/bin/../libexec/gcc/arm-none-eabi/4.6.2/lto-wrapper Target: arm-none-eabi Configured with: /home/build/work/jenkins-daily-build/src/gcc/configure --build=i686-linux-gnu --host=i686-linux-gnu --target=arm-none-eabi --prefix=/home/build/work/jenkins-daily-build/install-linux --enable-languages=c,c++ --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-lto --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-sysroot=/home/build/work/jenkins-daily-build/install-linux/arm-none-eabi --with-gmp=/home/build/work/jenkins-daily-build/build-linux/host-libs/usr --with-mpfr=/home/build/work/jenkins-daily-build/build-linux/host-libs/usr --with-mpc=/home/build/work/jenkins-daily-build/build-linux/host-libs/usr --with-ppl=/home/build/work/jenkins-daily-build/build-linux/host-libs/usr --with-cloog=/home/build/work/jenkins-daily-build/build-linux/host-libs/usr --with-libelf=/home/build/work/jenkins-daily-build/build-linux/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-extra-multilibs=armv6-m,armv7-m,armv7e-m,armv7-r Thread model: single gcc version 4.6.2 20121016 (release) [ARM/embedded-4_6-branch revision 192487] (GNU Tools for ARM Embedded Processors)