OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr21294.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR tree-optimization/21294
2
   VRP did not notice that an address of the form &p->i is nonnull
3
   when p is known to be nonnull.  In this testcase, noticing that
4
   allows us to eliminate the second "if" statement.  */
5
 
6
/* { dg-do compile } */
7
/* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1-details" } */
8
 
9
struct f {
10
  int i;
11
};
12
 
13
int
14
foo (struct f *p)
15
{
16
  if (p != 0)
17
    if (&p->i != 0)
18
      return 123;
19
  return 0;
20
}
21
 
22
/* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
23
/* { dg-final { cleanup-tree-dump "vrp1" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.