This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12468] New: empty loop not eliminated as dead code
- From: "bh at techhouse dot brown dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2003 19:25:01 -0000
- Subject: [Bug optimization/12468] New: empty loop not eliminated as dead code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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);
}