Issue 143046
Summary while loop miscompilation, likely due to invalid assumption
Labels new issue
Assignees
Reporter RetroDev256
    If x is greater than 0xfffffff5, then this should result in an infinite loop, due to integer overflow. In reality, clang compiles this to a simple `ret`.

```c
#include <stdint.h>

void loopGoBrrrr(uint32_t x) {
    uint32_t i = x;
    while (i <= x) {
 i += 10;
    }
}
```

Godbolt: (comparing GCC and Clang)
https://godbolt.org/z/ojWsxhcqE
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to