view gcc/testsuite/gcc.dg/ipa/ipa-sra-9.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-do run } */
/* { dg-options "-O3" } */

typedef unsigned int myint __attribute__((aligned(1)));

typedef struct S {
  unsigned a, b, c;
} SS;

typedef struct U {
  SS s[2];
} UU;

typedef UU __attribute__((aligned(1))) UUU;

static unsigned int __attribute__ ((noinline))
get_a (SS s)
{
  return s.a;
};

static int __attribute__ ((noinline, noclone))
foo (UUU *p)
{
  int r = (int) get_a(p->s[0]) + 2;
  return r;
}

char buf[512];

static UUU * __attribute__ ((noinline, noclone))
get_uuu (void)
{
  return (UUU *)(buf + 1);
}

int
main(int argc, char *argv[])
{
  UUU *p = get_uuu();
  if (foo(p) != 2)
    __builtin_abort ();
  return 0;
}