view gcc/testsuite/gcc.dg/pr46771.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/46771 */
/* { dg-do compile } */
/* { dg-options "-O -ftree-vectorize -fcompare-debug" } */
/* { dg-xfail-if "" { powerpc-ibm-aix* } } */

unsigned char v[1600];

unsigned char
foo (unsigned char x)
{
  int i;
  unsigned char a = x;
  unsigned char b = x;
  for (i = 0; i < 1600; i++)
    a = a < v[i] ? v[i] : a;
  for (i = 0; i < 1600; i++)
    b = b > v[i] ? v[i] : b;
  return a - b;
}