RE: GCC does not optimize out functions without side effects with asm statements inside loop even if return velue is ignored
lea0x9(%rdi),%r11 0x00400c16 <+214>: mov(%rdx,%r11,8),%rcx 0x00400c1a <+218>: cmp$0x80,%rcx 0x00400c21 <+225>: ja 0x400c38 <_Z28compile_test_asm_inside_loopv+248> 0x000000400c23 <+227>: lea0xa(%rdi),%rax
GCC does not optimize out functions without side effects with asm statements inside loop even if return velue is ignored
g++ (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3) In the below case compile_test_asm_inside_loop invokes test_asm_inside_loop and ignores results. The call into test_asm_inside_loop is expected to be eliminated since return value is not used and there is no side effect The call elimination works fine w