[test-suite] r176903 - Perform the atomic operations on a global, rather then a local stack variable.
Chad Rosier
mcrosier at apple.com
Tue Mar 12 15:07:01 PDT 2013
Author: mcrosier
Date: Tue Mar 12 17:07:00 2013
New Revision: 176903
URL: http://llvm.org/viewvc/llvm-project?rev=176903&view=rev
Log:
Perform the atomic operations on a global, rather then a local stack variable.
This was causing failures on one of our internal -O0 testers.
The issue appears to be that spills/refills to/from the stack are clearing the
monitor and causing the atomic operations to fail, which results in the benchmark
going into an infinite loop. This seems to only happen at -O0 because the
fast-regalloc is generating a reload in-between the excusive load and exclusive
store to a stack slot adjacent to the local variable x.
rdar://13363219
Modified:
test-suite/trunk/SingleSource/UnitTests/AtomicOps.c
Modified: test-suite/trunk/SingleSource/UnitTests/AtomicOps.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/AtomicOps.c?rev=176903&r1=176902&r2=176903&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/AtomicOps.c (original)
+++ test-suite/trunk/SingleSource/UnitTests/AtomicOps.c Tue Mar 12 17:07:00 2013
@@ -5,8 +5,8 @@ int foo(volatile *mem, int val, int c) {
return oldval + c;
}
+volatile int x = 0;
int main() {
- volatile int x = 0;
int y = foo(&x, 1, 2);
printf("%d, %d\n", y, x);
y = __sync_val_compare_and_swap(&x, 1, 2);
More information about the llvm-commits
mailing list