view gcc/testsuite/gcc.dg/tree-ssa/20040729-1.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 compile } */
/* { dg-options "-O1 -fdump-tree-dce3" } */

int
foo ()
{
  volatile int *p;
  volatile int x;

  p = &x;
  *p = 3;
  return *p + 1;
}

/* The assignment to 'p' is dead and should be removed.  But the
   compiler was mistakenly thinking that the statement had volatile
   operands.  But 'p' itself is not volatile and taking the address of
   a volatile does not constitute a volatile operand.  */
/* { dg-final { scan-tree-dump-times "&x" 0 "dce3"} } */