Skip to content

volatile_load & volatile_store fail on structs #11424

@lexs

Description

@lexs

volatile load/store as implemented in #11173 fails on structs.

test.rs

use std::intrinsics::{volatile_load, volatile_store};

struct Test {
    _buffer: [u8, ..256]
}

static mut test: Test = Test { _buffer: [0, ..256] };

pub fn main() {
    unsafe {
        let _a = volatile_load(&test);
        // volatile_store(&mut test, test);
    }
}

volatile_load:

Found return instr that returns non-void in Function of void return type!
  ret %struct.Test %3
 voidBroken module found, compilation aborted!

volatile_store:

rustc: …/src/llvm/lib/IR/Instructions.cpp:1085: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions