http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54937



             Bug #: 54937

           Summary: Invalid loop bound estimate

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: tree-optimization

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: hubi...@gcc.gnu.org





The following loop gets predicted incorrectly to have 0 iterations while, it

iterates once.



void exit (int);

void abort (void);

int a[1];

void (*terminate_me)(int);



__attribute__((noinline,noclone))

t(int c)

{ int i;

  for (i=0;i<c;i++)

    {

      if (i)

       terminate_me(0);

      a[i]=0;

    }

}

main()

{

  terminate_me = exit;

  t(100);

  abort();

}

Reply via email to