[llvm-gcc] volatile lost in struct copy #1724
Labels
bugzilla
Issues migrated from bugzilla
llvm-tools
All llvm tools that do not have corresponding tag
miscompilation
Extended Description
I typed this into the online demo:
struct foo {
int x;
};
void copy(volatile struct foo *p, struct foo *q)
{
*p = *q;
}
It produced this:
void %copy(%struct.foo* %p, %struct.foo* %q) {
entry:
%tmp2 = getelementptr %struct.foo* %q, int 0, uint 0 ; <int*> [#uses=1]
%tmp = load int* %tmp2 ; [#uses=1]
%tmp4 = getelementptr %struct.foo* %p, int 0, uint 0 ; <int*> [#uses=1]
store int %tmp, int* %tmp4
ret void
}
The store should be volatile.
The text was updated successfully, but these errors were encountered: