view gcc/testsuite/gcc.dg/pr65779.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
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;
}