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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [vrp03.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-vrp1" } */
3
 
4
struct A
5
{
6
  int a;
7
  int b;
8
};
9
 
10
foo (struct A *p, struct A *q)
11
{
12
  int *r = 0;
13
 
14
  if (p)
15
    {
16
      if (p == q)
17
        {
18
          /* This should be folded to 'if (1)' because q is [p, p]
19
             and p is ~[0, 0].  */
20
          if (q)
21
            r = &q->a;
22
 
23
          /* This should be folded to 'if (1)' because q should be
24
             ~[0, 0] and thus &q->a should be ~[0, 0].  */
25
          if (r)
26
            return 5;
27
        }
28
    }
29
 
30
  return q->a;
31
}
32
 
33
/* { dg-final { scan-tree-dump-times "Folding predicate q_.*to 1" 1 "vrp1" } } */
34
/* { dg-final { scan-tree-dump-times "Folding predicate r_.*to 1" 1 "vrp1" } } */
35
/* { 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.