The REPLACE_SHIFTL_SHIFTL and REPLACE_SHIFTR_SHIFTR peephole optimizations fold '(a << b) << c' into 'a << (b + c)' (and likewise for '>>'), but computed 'b + c' in the width of the shift-amount operand. When 'b + c' overflows that width it wraps around, producing a too-small shift amount and a wrong result. Compute the sum one bit wider than the amounts so it cannot overflow. Fixes #7955 |
||
|---|---|---|
| .. | ||
| t | ||
| .gdbinit | ||
| .gitignore | ||
| AGENTS.md | ||
| CMakeLists.txt | ||
| Makefile | ||
| Makefile_obj | ||
| driver.py | ||
| input.vc | ||
| input.xsim.vc | ||
| tsan.supp | ||