view gcc/testsuite/gcc.dg/pr51628-18.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

/* PR c/51628.  */
/* { dg-do compile } */
/* { dg-options "-O" } */

void foo (int *);

int *
bar (int n, int k, void *ptr)
{
  struct A
  {
    int c[k];
    int x[n];
  } __attribute__ ((packed, aligned (4)));
  struct A *p = (struct A *) ptr;

  int *p0, *p1;
  p0 = p->x;
  foo (p0);
  p1 = &p->x[1];
  foo (p1);
  return &p->x[1];
}