This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/78194] New: Failure to optimize squaring
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Nov 2016 09:47:14 +0000
- Subject: [Bug tree-optimization/78194] New: Failure to optimize squaring
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78194
Bug ID: 78194
Summary: Failure to optimize squaring
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
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.