https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101868
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Works for me on the trunk: repro: .LFB9: .cfi_startproc subq $24, %rsp testq %rsi, %rsi je .L14 movq (%rsi), %rax testq %rax, %rax jne .L15 .L10: addq $24, %rsp ... .L14: xorl %edi, %edi call rb_check_type.isra.0 movq 0, %rax jmp .L10 .L15: movq %rsi, %rdi movq %rax, 8(%rsp) call rb_check_type.isra.0 movq 8(%rsp), %rax jmp .L10