-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
Description
| Bugzilla Link | 25526 |
| Resolution | FIXED |
| Resolved on | Nov 19, 2016 14:13 |
| Version | trunk |
| OS | All |
| CC | @compnerd,@emaste,@jyknight,@kbeyls,@TNorthover |
Extended Description
When compiling this at -O0:
define {i64, i1} @​foo(i64* %addr, i64 %desired, i64 %new) {
%old = cmpxchg i64* %addr, i64 %desired, i64 %new seq_cst seq_cst
ret {i64, i1} %old
}
Fast-regalloc seems to insert many spills between the ldaxr and the stlxr. If these are on the same cache-line as %addr (in practice) then they can reset the monitor causing the operation to fail.
ARM is almost certainly affected too. But both only at -O0.
I'm still not sure what to do about this one. Some obvious options are:
- Go back to lots of pseudo-instructions for various different uses. Extremely nasty, we worked very hard to get rid of those for better codegen.
- Disable fast-regalloc in all cases. Probably bad for debug quality, so I doubt this is viable.
- Emit libcalls at -O0. I'm not sure all platforms support these though, we'd have to make sure they're available.