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/] [vrp02.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 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 x = p->a;
13
  if (p == q)
14
    return q->a;
15
 
16
  /* We should fold this to 'if (1)' but the assertion for 'p == q'
17
     was overwriting the assertion 'p != 0' from the first dereference
18
     of 'p'.  */
19
  if (p)
20
    return x + p->b;
21
}
22
 
23
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
24
/* { 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.