Skip to content

GUFA miscompilation with shared i31 cast #6776

@tlively

Description

@tlively
(module (table $0 3 3 (ref null (shared any))) (elem $0 (table $0) (i32.const 0) (ref null (shared i31)) (item (ref.i31_shared (i32.const 999)))) (func $0 (export "get") (param $0 i32) (result (ref null (shared any))) (ref.cast (ref null (shared i31)) (table.get $0 (i32.const 0) ) ) ) ) 

Running wasm-opt -all -tnh --gufa-cast-all test.wast -S -o - optimizes the function body to just (ref.null (shared none)), which is not correct. I tried debugging this and I figured out that there is an intermediate state where the ref.cast type has been changed to (ref null (shared none)), but I haven't been able to figure out why it's doing that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions