https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102888
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2021-10-22 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. The complication is that the loop is rotated to do { } while () form and that puts div and mod of different iterations next to each other: <bb 2> [local count: 118111600]: _8 = a_3(D) % b_4(D); if (_8 == 0) goto <bb 5>; [89.00%] else goto <bb 4>; [11.00%] <bb 5> [local count: 105119324]: <bb 3> [local count: 955630225]: # a_9 = PHI <a_7(6), a_3(D)(5)> a_7 = a_9 / b_4(D); _1 = a_7 % b_4(D); if (_1 == 0) goto <bb 6>; [89.00%] else goto <bb 4>; [11.00%] <bb 6> [local count: 850510901]: goto <bb 3>; [100.00%] <bb 4> [local count: 118111600]: # a_10 = PHI <a_7(3), a_3(D)(2)> return a_10;