| Issue |
208997
|
| Summary |
[Clang] Miscompilation with _Atomic variable and assignment-operator
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
fuhsnn
|
https://c.godbolt.org/z/d8v6bdGK3
```C
#include <stdio.h>
int main(void) {
_Atomic int i = 1;
int x = (i += -6.0);
printf("%d\n", i); // expect -5, got junk
printf("%d\n", x); // expect -5, got junk
}
```
The assembly looks like the RHS `-6.0` is wrongly omitted and `lock add` is instead loading uninitialized `%eax` value.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs