view gcc/testsuite/gcc.dg/pr65779.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +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;
}