view gcc/testsuite/gcc.dg/pr65779.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* PR debug/65779 */
/* { dg-do assemble } */
/* { dg-options "-O2 -fcompare-debug" } */
/* { dg-xfail-if "" { powerpc-ibm-aix* } } */

unsigned long
foo (unsigned long x, unsigned char *y, unsigned int z)
{
  unsigned long a = x & 0xffff;
  unsigned long b = (x >> 16) & 0xffff;
  int k;
  if (y == 0) return 1L;
  while (z > 0)
    {
      k = z < 5552 ? z : 5552;
      z -= k;
      while (k >= 16)
	{
          a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  a += *y++; b += a;
	  k -= 16;
        }
      if (k != 0)
	do { a += *y++; b += a; } while (--k);
      a %= 65521L;
      b %= 65521L;
    }
  return (b << 16) | a;
}