https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105731
Bug ID: 105731 Summary: superfluous second operation before conditional branch -O2 -mcpu=cortex-m0plus Product: gcc Version: og10 (devel/omp/gcc-10) Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@little-bat.de Target Milestone: --- gcc 10.3.1 misses an easy oportunity for optimization: Instruction: if ((bits<<=1)>=0) goto p3; generated code: strh r7, [r0, #4] lsls r3, r2, #1 lsls r2, r2, #1 bpl .L8 i believe the 2nd "lsls" is superfluous. It would save me 3MHz if it wasn't there. :-) full example: https://godbolt.org/z/xocbvjn5x