view gcc/testsuite/g++.dg/tree-ssa/alias-access-path-1.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

/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-fre1" } */

struct a {int a1; int a2;};
struct b:a {};

struct b bvar,*bptr2;
int
test(void)
{
  struct a *bptr = &bvar;
  bptr->a2=0;
  bptr2->a1=1;
  return bptr->a2;
}
int
test2(void)
{
  struct b *bptr = &bvar;
  bptr->a2=0;
  bptr2->a1=1;
  return bptr->a2;
}
/* { dg-final { scan-tree-dump-times "return 0" 2 "fre1" } } */