Skip to content

riscv64: Bus error on qemu when executing atomic_cas.i64 #10982

@akldc

Description

@akldc

.clif Test Case

test optimize    
    set opt_level=none
    set preserve_frame_pointers=true
    set enable_multi_ret_implicit_sret=true
            

function u1:1() ->  i64 fast {
    ss1 = explicit_slot 32
    const0 = 0x138570c7f69308b3f282b35c6e347036

block0:
    v8 = iconst.i64 -2844296266602371941   
    stack_store v8, ss1
    stack_store v8, ss1+8  
    stack_store v8, ss1+16 
    stack_store v8, ss1+24
    v27 = stack_addr.i64 ss1+5
    v28 = atomic_cas.i64 v27, v8, v8
    return v28
}

; print: %main()

Versions and Environment

Target Architecture: riscv64
Environment: qemu-riscv64 to emulate execution on an x86 machine.

Results

When executing this test case, qemu crashes with a bus error and returns exit code -7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingcraneliftIssues related to the Cranelift code generatorcranelift:area:riscv64Issues related to the RISC-V 64 backend.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions