This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/12468] New: empty loop not eliminated as dead code


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);
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]