In the attached code, changing if (numbers[maxIdx] < numbers[maxIdx + 1]) maxIdx++; to maxIdx += numbers[maxIdx] < numbers[maxIdx + 1]; gives a 10% performance speedup at -O3.
Created attachment 16149 [details] benchmark this is a modified version of the PR37239 testcase, with the optimization requested there performed manually.
I think this is a dup of bug 30521.
*** This bug has been marked as a duplicate of 30521 ***