view gcc/testsuite/gcc.dg/Wrestrict-17.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

/* PR tree-optimization/85826 - ICE in gimple-ssa-warn-restruct on
   a variable-length struct
   { dg-do compile }
   { dg-options "-O2 -Wall" }  */

int f (int n)
{
  typedef struct { int a[n]; } S;

  S a;
  __attribute__ ((noinline)) S g (void) { return a; }

  a.a[0] = 1;
  a.a[9] = 2;

  S b;
  b = g ();

  return b.a[0] == 1 && b.a[9] == 2;
}