view gcc/testsuite/gcc.dg/tree-ssa/pr84859.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children 1830386684a0
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O2 -Warray-bounds -fdump-tree-phiopt2" } */

void
h (const void *p, unsigned n)
{
  unsigned char a[8];
  if (n > sizeof a)
    return;

  for (; n > 0; n -= *a)
    {
      if (n > 255)
	*a = 255;
      else
	*a = n;

      __builtin_memcpy (a, p, *a);   /* { dg-bogus "bounds" } */
    }
}

/* { dg-final { scan-tree-dump "MIN_EXPR" "phiopt2" } } */