Bugzilla – Bug 511
[cbackend] C backend does not respect 'volatile'
Last modified: 2005-02-14 23:54:01
You need to log in before you can comment on or make changes to this bug.
Consider this testcase: void %test(int* %P) { %X = volatile load int*%P volatile store int %X, int* %P ret void } The CBE currently emits: void test(int *l1_P) { int l2_X; l2_X = *l1_P; *l1_P = l2_X; return; } ... which GCC correctly optimizes to: test: ret The C Backend should emit volatile pointer qualifiers to get the right thing to happen.
Fixed. Testcase here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050214/024098.html Patch here: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050214/024099.html -Chris
Actually that patch was not quite right. This one fixes it: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050214/024121.html