https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65855
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|missing optimization: |SCEV / SCCP missing
|triangular numbers |optimization: triangular
| |numbers
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
From the duplicate a related testcase:
int square(int x) {
int result = 0;
for (int i = 0; i < x; ++i)
result += x;
return result;
}
is not optimized into return x * x; while llvm can do that.