view gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-61.c @ 145:1830386684a0

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

/* { dg-do link { target natural_alignment_32 } } */
/* { dg-options "-O -fdump-tree-fre1-details" } */

void link_error (void);

void test1 (int *p, int *q)
{
  *p = 1;
  *q = 1;
  if (*p != 1)
    link_error ();
}

void test2 (int *p, int *q, int t)
{
  *p = t;
  *q = t;
  if (*p != t)
    link_error ();
}

void test3 (int *q, int *p)
{
  int tem = *p;
  *q = tem;
  if (*p != tem)
    link_error ();
}

char a[4];
struct A { char a[4]; };
void test4 (struct A *p)
{
  a[0] = p->a[0];
  a[0] = p->a[0];
  a[0] = p->a[0];
}

int main() { return 0; }

/* { dg-final { scan-tree-dump-times "Replaced \\\*p" 3 "fre1" } } */
/* { dg-final { scan-tree-dump-times "Replaced p_.\\(D\\)->" 2 "fre1" } } */
/* { dg-final { scan-tree-dump-times "Deleted redundant store a\\\[0\\\]" 2 "fre1" } } */