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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
__attribute__((noipa))
void
test (unsigned int *dst, unsigned int base, int count)
{
  int i = 0;
  while (i < count)
    dst[i++] = (base += 15);
}

int
main (void)
{
  unsigned int dst[100];
  test (dst, 0x4000, 100);
}

and

__attribute__((noipa))
void
test (unsigned int *dst, unsigned int base, int count)
{
  int i = 0;
  do
    dst[i++] = (base += 15);
  while (i < count);
}

int
main (void)
{
  unsigned int dst[100];
  test (dst, 0x4000, 100);
}

show that too.  For the do while loop, not sure if we shouldn't have something
also one recommended location at the start of the do/while loop on do line,
then of course in the body and then on the while condition.  For while loop at
the start of the condition.  Also, in C++ we have range-for loops that need
some thinking too.

Reply via email to