This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/76174] New: Missed loop optimization
- From: "jrmuizel at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 13 Aug 2016 17:08:22 +0000
- Subject: [Bug middle-end/76174] New: Missed loop optimization
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=76174
Bug ID: 76174
Summary: Missed loop optimization
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: jrmuizel at gmail dot com
Target Milestone: ---
The call to m is not removed from the following code:
void m();
void l(unsigned int r) {
unsigned int q = 0;
unsigned int c = r;
for (unsigned int x = 0; x<r; x++) {
if (q == c) {
m();
c *= 2;
}
q++;
}
}
if the line 'c *= 2' is removed the optimizer successfully optimizes away the
body of the function.