diff --git a/ir_x86.dasc b/ir_x86.dasc index 681d1a6..528157e 100644 --- a/ir_x86.dasc +++ b/ir_x86.dasc @@ -1370,8 +1370,7 @@ binop_fp: ctx->flags |= IR_HAS_CALLS; IR_FALLTHROUGH; case IR_TAILCALL: - if (ir_input_edges_count(ctx, insn) == 2 /* no arguments */ - && insn->op2 > bb->start + if (insn->op2 > bb->start && insn->op2 < ref && !ctx->rules[insn->op2]) { ir_match_fuse_load(ctx, insn->op2, bb); diff --git a/tests/debug.x86/call3.irt b/tests/debug.x86/call3.irt index 5876850..12e3f00 100644 --- a/tests/debug.x86/call3.irt +++ b/tests/debug.x86/call3.irt @@ -24,7 +24,6 @@ test: movl %ebx, 0x18(%esp) movl 0x20(%esp), %ebx movl 0x30(%esp), %eax - movl (%eax), %eax leal .L1, %ecx movl %ecx, (%esp) movl 0x28(%esp), %ecx @@ -33,12 +32,12 @@ test: movl %ecx, 8(%esp) movl 0x24(%esp), %ecx movl %ecx, 0xc(%esp) - calll *%eax + calll *(%eax) leal (%eax, %ebx), %eax movl 0x18(%esp), %ebx addl $0x1c, %esp retl .rodata - .db 0x90 + .db 0x90, 0x90, 0x90 .L1: .db 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x25, 0x64, 0x21, 0x0a, 0x00 diff --git a/tests/debug/call3.irt b/tests/debug/call3.irt index d5de0cf..26fbebf 100644 --- a/tests/debug/call3.irt +++ b/tests/debug/call3.irt @@ -23,18 +23,16 @@ test: subq $8, %rsp movq %rbx, (%rsp) movl %edi, %ebx - movq (%r8), %rax - movl %ecx, %r8d + movl %ecx, %eax movl %esi, %ecx movl %edx, %esi - movl %r8d, %edx + movl %eax, %edx leaq .L1(%rip), %rdi - callq *%rax + callq *(%r8) leal (%rax, %rbx), %eax movq (%rsp), %rbx addq $8, %rsp retq .rodata - .db 0x90, 0x90, 0x90, 0x90 .L1: .db 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x25, 0x64, 0x21, 0x0a, 0x00