https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109896
--- Comment #5 from Thiago Macieira <thiago at kde dot org> --- (In reply to Andrew Pinski from comment #4) > If you are that picky for cycles, these cycles are not going to be a problem > compared to the dynamic allocation that is just about to happen ...... Yeah, I realised that after I posted the reply. If the calculation is successful, we're going to allocate memory and that's neither fast nor determinstic. If it overflows, we're going to unwind the stack, which is even worse. I had only looked at the multiplication and failed to consider what comes after it. So, yeah, do this if it's a low-hanging fruit.