compiler-explorer / compiler-explorer

Run compilers interactively from your web browser and interact with the assembly

Home Page:https://godbolt.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: Hylo compiler error

167rgc911 opened this issue · comments

commented

Describe the bug

Hylo compile error

Compiler output

Unexpected error

Error: The operation could not be completed. No such file or directory
Compiler returned: 1

Executor output

Could not execute the program
Compiler returned: 1
Compiler stdout

Unexpected error

Compiler stderr

Error: The operation could not be completed. No such file or directory

Steps to reproduce

Visit: https://godbolt.org/z/f7Gfvz3Tq

Editor input

public fun factorial(_ n: Int) -> Int {
  if n < 2 { 1 } else { n * factorial(n - 1) }
}

public fun main() -> Int32 {
  Int32(factorial(5))
}

Expected behavior

Verified this output with a local compiler-explorer instance.

commit f710f316cd41a2b6cabfd4aac676e9fb4df53f4d (HEAD -> main, tag: gh-11270, github/main, github/HEAD)

With hylo local build

commit b31d5bd1562d07ab82983136e21cfb4aaf37f67e (HEAD -> main, origin/main, origin/HEAD)

Compiler output

.LM7exampleU7exampleF04main0lTR70aTR0U5Int32A5Int32Z:
        subq    $24, %rsp
        movq    %rdi, (%rsp)
        movq    $5, 16(%rsp)
        leaq    16(%rsp), %rdi
        leaq    8(%rsp), %rsi
        callq   M7exampleU7exampleF09factorial0lTR710pT1aTR2ZK3@PLT
        movq    (%rsp), %rdi
        leaq    8(%rsp), %rsi
        xorl    %eax, %eax
        movl    %eax, %edx
        callq   R0U5Int32A5Int32sF04init0lTR724selfpT2aTK1Z0pT1aTR2ZR7@PLT
        addq    $24, %rsp
        retq

M7exampleU7exampleF09factorial0lTR710pT1aTR2ZK3:
        subq    $56, %rsp
        movq    %rdi, (%rsp)
        movq    %rsi, 8(%rsp)
        movq    (%rsp), %rdi
        movq    $2, 24(%rsp)
        leaq    24(%rsp), %rsi
        leaq    16(%rsp), %rdx
        callq   R0U3IntcDaTR2ZZF1010lTtT14selfrT1K210pT1K2aTR1Z$jP9@PLT
        testb   $1, 16(%rsp)
        jne     .LBB1_3
        movq    (%rsp), %rdi
        movq    $1, 48(%rsp)
        leaq    48(%rsp), %rsi
        leaq    40(%rsp), %rdx
        callq   R0U3IntcDaTR2ZZF1010lTtT14selfrT1K210pT1K2K2$jJ@PLT
        leaq    40(%rsp), %rdi
        leaq    32(%rsp), %rsi
        callq   M7exampleU7exampleF09factorial0lTR710pT1aTR2ZK3@PLT
        movq    (%rsp), %rdi
        movq    8(%rsp), %rdx
        leaq    32(%rsp), %rsi
        callq   R0U3IntcDaTR2ZZF1010lTtT14selfrT1K210pT1K2K2$jG@PLT
        jmp     .LBB1_4
.LBB1_3:
        movq    8(%rsp), %rax
        movq    $1, (%rax)
.LBB1_4:
        addq    $56, %rsp
        retq

main:
        pushq   %rax
        movq    %rsp, %rdi
        callq   .LM7exampleU7exampleF04main0lTR70aTR0U5Int32A5Int32Z
        movl    (%rsp), %eax
        popq    %rcx
        retq

Executor output

Program returned: 120

Reproduction link

https://godbolt.org/z/f7Gfvz3Tq

Screenshots

godbolt.org
2024-04-12-061006_1366x768_scrot

local instance
2024-04-12-061254_1366x768_scrot

Operating System

Alpine Linux

Browser version

Firefox