https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85880
--- Comment #2 from Fredrik Hederstierna <fredrik.hederstie...@securitas-direct.com> --- All old GCC < 8 --------------- Disassembly of section .text: 00000000 <get_undef_stack_var>: 0: 2000 movs r0, #0 2: 4770 bx lr 00000004 <test_1>: 4: b500 push {lr} 6: 2000 movs r0, #0 8: bd00 pop {pc} 0000000a <test_2>: a: b500 push {lr} c: 2000 movs r0, #0 e: bd00 pop {pc} ------------------------------------------------------ From GCC 8.1.0 --------------- Disassembly of section .text: 00000000 <get_undef_stack_var>: 0: 2000 movs r0, #0 2: 4770 bx lr 00000004 <test_1>: 4: b500 push {lr} 6: 2000 movs r0, #0 8: bd00 pop {pc} 0000000a <test_2>: a: 2380 movs r3, #128 ; 0x80 c: b510 push {r4, lr} e: 005b lsls r3, r3, #1 10: 2000 movs r0, #0 12: 2b00 cmp r3, #0 14: d101 bne.n 1a <test_2+0x10> 16: f7ff fffe bl 0 <call_external_func> 1a: bd10 pop {r4, pc}