view gcc/testsuite/gcc.dg/vect/pr63530.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

/* { dg-additional-options "-funroll-loops --param \"max-completely-peeled-insns=400\"" } */

/* PR tree-optimization/63530 */
/* On armv7 hardware, following options cause run time failure  */
/*   -march=armv7-a -mfloat-abi=hard -mfpu=neon -marm -O2 -ftree-vectorize  */
/*   -funroll-loops --param "max-completely-peeled-insns=400"  */

#include "tree-vect.h"

#include <stdlib.h>

typedef struct {
  unsigned char map[256];
  int i;
} A, *AP;

AP __attribute__ ((noinline))
foo (int n)
{
  AP b = (AP)calloc (1, sizeof (A));
  int i;
  for (i = n; i < 256; i++)
    b->map[i] = i;
  return b;
}

int
main()
{
  AP p = foo(3);
  check_vect ();
  return p->map[30] - p->map[20] - p->map[10];
}