https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67242

            Bug ID: 67242
           Summary: Missing optimization with float
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: f.boesing at gmx dot de
  Target Milestone: ---

testcase:

int n, dummy;
float dummyfloat;

void bug(void) 
{
 for(n=0; n<1000; n++)
    dummy = n;
 for(n=0; n<1000; n++)
    dummyfloat = n;
}

the first loop (dummy=) is optimized away with -O2 and -O3
the second (dummyfloat=) NOT.

Tested with 4.9.2 & 4.9.3, targets x86-64, arm-thumb and arm.

commandline: gcc -O2 bug.c -S

Reply via email to