Skip to content

__smo and __log intrinsics not correctly compiled and can cause ICE #7572

@ironcev

Description

@ironcev

__smo and __log intrinsics return unit () but the returned value is not correctly compiled in the IR. Instead of having a const () as their return value they just return their underlaying IR instruction that does not return a value.

E.g. compiling the following script producess ICEs:

script;

fn main() {
    poke(__smo(b256::zero(), 0u64, 0));
    //   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Internal compiler error: An attempt to get register for unknown Value.
    poke(__log(0u64));
    //   Internal compiler error: An attempt to get register for unknown Value.
}

#[inline(never)]
fn poke<T>(_x: T) {}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompilerGeneral compiler. Should eventually become more specific as the issue is triagedcompiler: irIRgen and sway-ir including optimization passes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions