view gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-30.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

/* PR tree-optimization/80933 - redundant bzero/bcopy calls not eliminated
   { dg-do compile }
   { dg-options "-O2 -fdump-tree-dse1" } */

void sink (void*);

void test_bcopy (const void *s)
{
  char d[33];

  /* Bcopy is transformed into memmove and those calls are expanded
     inline in EVRP, before DSE runs, so this test doesn't actually
     verify that DSE does its job.  */
  __builtin_bcopy (s, d, sizeof d);
  __builtin_bcopy (s, d, sizeof d);

  sink (d);
}

void test_bzero (void)
{
  char d[33];

  __builtin_bzero (d, sizeof d);
  __builtin_bzero (d, sizeof d);

  sink (d);
}

/* { dg-final { scan-tree-dump-times "builtin_memset" 1 "dse1" } } */
/* { dg-final { scan-tree-dump-not "builtin_(bcopy|bzero|memcpy|memmove)" "dse1" } } */