https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96336
--- Comment #1 from Fabio Azevedo <fazedo at gmail dot com> --- int f(int x) { return x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x; //x**16 } int g(int x) { return x*x*x*x*x*x*x*x*x*x*x*x*x*x*x*x + x*x; //x**16 + x**2 } Using gcc -O3, the first function simplifies to 4 integer multiplications while the second function requires 13.