vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.85k stars 791 forks source link

Experimental Codegen Fails to Compile for Complex Ternary #4070

Open ritzdorf opened 4 months ago

ritzdorf commented 4 months ago

Version Information

Issue description

The experimental code-gen fails to compile with the error:

vyper.exceptions.CompilerPanic: unreachable: %16:1 = phi %16:8, label %8_then, %16, label %6_then from 4_then

However, this only seems to occur when no optimization is performed.

POC

@internal
def bar() -> uint256:
    return 1

@external
def foo():
    l: decimal = convert(isqrt(self.bar()), decimal) if True else 1.0

To reproduce:

vyper --enable-decimals --experimental-codegen -O none foo.vy