BreadTom

Results issues of BreadTom

[Godbolt](https://godbolt.org/z/5nccedzj1) ```c int test1 (int a) { if (a < 0 || a > 1) __builtin_unreachable (); return (2 >> a) == (2 - a); } int test2 (int a)...

llvm:instcombine
missed-optimization

When Clang compile this [code](https://godbolt.org/z/6Kvf11MT5), it incorrectly optimizes it to nothing at -O3. The latest Clang that did compile the code correct was Clang 11.0.1. Adding a (uint64_t) at line...

clang:frontend
clang:diagnostics
undefined behaviour

C code: func1 only differs by using another bool from comparison of (ptr[n] == '_'). Otherwise, they should behave exactly the same. ``` #include #include unsigned long func0(unsigned char *...

llvm:optimizations
missed-optimization

Clang x86 20.1.2 incorrectly assumes that (ret_vector0[n] > 1) on line 59 might be true, thus clearing the whole function while GCC 14.2 generates same code without unreachable(). https://godbolt.org/z/sK4GWYbGW ```...

clang
miscompilation

https://godbolt.org/z/adf71b63Y f1() should optimized to f0(). f0() should call strlen just like GCC 14.2. C code ``` #include size_t f0(char *str){ size_t i = 0; for(; str[i] != '\0'; ++i){...

llvm:optimizations
missed-optimization

https://godbolt.org/z/z9q399GEe C code: ``` #include __attribute__((noinline)) size_t inc(size_t n){ return n + 1; } size_t f0(char *str){ size_t i = 0; for(; str[i] != '\0';++i){ } return i; } size_t...

llvm:optimizations
missed-optimization

See [godbolt](https://godbolt.org/z/5Wh8sG958) and [GCC bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120038). ``` #include #include uint64_t collatz_onlyoddstep (uint64_t oddnum){ return (3 * oddnum + 1); } uint64_t collatz_oddstep (uint64_t oddnum) { return (3 * oddnum + 1)...

backend:X86
missed-optimization

[Godbolt](https://godbolt.org/z/b57EK93e3) and [GCC Bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120268) ``` void f0(unsigned char *ptr, unsigned long len){ for(unsigned long i = 0; i < len; ++i){ ptr[i] = 0; } } void f1(unsigned char *ptr,...

invalid
loopoptim
missed-optimization

[Godbolt](https://godbolt.org/z/G89zK5brd) and [GCC bug](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120279) ``` unsigned long f0(unsigned long arg0, int arg1){ int tmp1; if(arg1){ tmp1 = __builtin_ctzg(arg0, 0); return (arg0 >> tmp1); } tmp1 = __builtin_clzg(arg0, 0); return (arg0...

llvm:optimizations
missed-optimization