forked from JuliaHubOSS/llvm-cbe
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
A common idiom for memory-mapped I/O is this:
void f(void)
{
(*(volatile uint8_t*)42) = 23;
}
clang-3.8 correctly compiles this into a volatile store in LLVM IR:
define void @f() #0 {
store volatile i8 23, i8* inttoptr (i64 42 to i8*), align 1
ret void
}
However, the cbe drops the volatile:
void f(void) {
*((uint8_t*)(uintptr_t)UINT64_C(42)) = 23;
}
Philipp
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels