(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
tree-ssa/
alias-18.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -fdump-tree-fre1-details -fdump-tree-optimized" } */
       3  
       4  struct A {
       5    int i;
       6    int j;
       7    float x;
       8  };
       9  struct B {
      10    struct A a;
      11    int k;
      12  };
      13  
      14  int g;
      15  
      16  int test0 (struct A *p, struct A *q)
      17  {
      18    p->i = 0;
      19    q->j = -1;
      20    return p->i;
      21  }
      22  
      23  int test1 (struct A *p, struct B *q)
      24  {
      25    p->i = 1;
      26    q->k = -1;
      27    return p->i;
      28  }
      29  
      30  int test2 (struct A *p, struct B *q)
      31  {
      32    p->i = 2;
      33    q->a.i = -1;
      34    return p->i;
      35  }
      36  
      37  int test3 (struct A *p, struct B *q)
      38  {
      39    p->i = 3;
      40    q->a.j = -1;
      41    return p->i;
      42  }
      43  
      44  int test4 (struct A *p)
      45  {
      46    g = 4;
      47    p->i = -1;
      48    return g;
      49  }
      50  
      51  int test5 (struct A *p)
      52  {
      53    p->i = 5;
      54    g = -1;
      55    return p->i;
      56  }
      57  
      58  int test6 (struct A *p, int *q)
      59  {
      60    p->i = 6;
      61    *q = -1;
      62    return p->i;
      63  }
      64  
      65  int test7 (struct A *p, int *q)
      66  {
      67    p->j = 7;
      68    *q = -1;
      69    return p->j;
      70  }
      71  
      72  int test8 (struct A *p, int *q)
      73  {
      74    *q = 8;
      75    p->x = -1;
      76    return *q;
      77  }
      78  
      79  /* { dg-final { scan-tree-dump "with 0" "fre1" } } */
      80  /* { dg-final { scan-tree-dump "with 1" "fre1" } } */
      81  /* { dg-final { scan-tree-dump "with 3" "fre1" } } */
      82  /* { dg-final { scan-tree-dump "with 4" "fre1" } } */
      83  /* { dg-final { scan-tree-dump "with 5" "fre1" } } */
      84  /* { dg-final { scan-tree-dump "with 8" "fre1" } } */
      85  /* { dg-final { scan-tree-dump-not "return 2;" "optimized" } } */
      86  /* { dg-final { scan-tree-dump-not "return 6;" "optimized" } } */
      87  /* { dg-final { scan-tree-dump-not "return 7;" "optimized" } } */
      88  /* { dg-final { scan-tree-dump-not "return -1;" "optimized" } } */