[Bug optimization/12468] New: empty loop not eliminated as dead code
bh at techhouse dot brown dot edu
gcc-bugzilla@gcc.gnu.org
Tue Sep 30 19:55:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12468
Summary: empty loop not eliminated as dead code
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bh at techhouse dot brown dot edu
CC: gcc-bugs at gcc dot gnu dot org
The following two trivial loops are not eliminated as dead code in 3.3.1 using
-O2. The former (foo) is eliminated using -O2 -funroll-loops, but I'd rather
hope that I could eliminate dead code like this without also unrolling all my
loops. Also, -funroll-loops does horrible things to the latter loop (bar).
void foo() {
int i;
for(i=0;i<10;++i);
}
void bar(int n) {
int i;
for(i=0;i<n;++i);
}
More information about the Gcc-bugs
mailing list