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] - Diff between revs 816 and 826

Only display areas with differences | Details | Blame | View Log

Rev 816 Rev 826
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
 
 
foo (int i, int *p)
foo (int i, int *p)
{
{
  int j;
  int j;
 
 
  if (i > 10)
  if (i > 10)
    {
    {
      if (p)
      if (p)
        {
        {
          j = *p;
          j = *p;
          /* This should be folded to if (1) because of the parent 'if
          /* This should be folded to if (1) because of the parent 'if
             (p)'.  But the dereference of p above does not need an
             (p)'.  But the dereference of p above does not need an
             assertion.  */
             assertion.  */
          if (p)
          if (p)
            return j + 1;
            return j + 1;
        }
        }
    }
    }
  else
  else
    {
    {
      j = *p - 3;
      j = *p - 3;
      /* This should be folded to if (0), because p has just been
      /* This should be folded to if (0), because p has just been
         dereferenced.  But we were not inserting enough ASSERT_EXPRs
         dereferenced.  But we were not inserting enough ASSERT_EXPRs
         to figure it out.  */
         to figure it out.  */
      if (!p)
      if (!p)
        return j - 4;
        return j - 4;
    }
    }
 
 
  return i;
  return i;
}
}
/* Target with fno-delete-null-pointer-checks should not fold checks */
/* Target with fno-delete-null-pointer-checks should not fold checks */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 1" 1 "vrp1" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 0 "vrp1" { target {   keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "Folding predicate p_.*to 0" 0 "vrp1" { target {   keeps_null_pointer_checks } } } } */
 
 
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 2 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 1 "vrp1" { target {   keeps_null_pointer_checks } } } } */
/* { dg-final { scan-tree-dump-times "PREDICATE: p_\[0-9\]" 1 "vrp1" { target {   keeps_null_pointer_checks } } } } */
/* { dg-final { cleanup-tree-dump "vrp1" } } */
/* { 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.