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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
3
 
4
foo (int i, int *p)
5
{
6
  int j;
7
 
8
  if (i > 10)
9
    {
10
      if (p)
11
        {
12
          j = *p;
13
          /* This should be folded to if (1) because of the parent 'if
14
             (p)'.  But the dereference of p above does not need an
15
             assertion.  */
16
          if (p)
17
            return j + 1;
18
        }
19
    }
20
  else
21
    {
22
      j = *p - 3;
23
      /* This should be folded to if (0), because p has just been
24
         dereferenced.  But we were not inserting enough ASSERT_EXPRs
25
         to figure it out.  */
26
      if (!p)
27
        return j - 4;
28
    }
29
 
30
  return i;
31
}
32
/* Target with fno-delete-null-pointer-checks should not fold checks */
33
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
34
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
35
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 0 "vrp1" { target {   keeps_null_pointer_checks } } } } */
36
 
37
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
38
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 1 "vrp1" { target {   keeps_null_pointer_checks } } } } */
39
/* { 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.