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

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-vrp1-details" } */
3
 
4
static int blocksize = 4096;
5
 
6
int bar (int);
7
 
8
void foo (void)
9
{
10
  int toread;
11
  int bytes;
12
  static char eof_reached = 0;
13
 
14
  toread = blocksize;
15
  bytes = 1;
16
 
17
  while (toread != 0)
18
    {
19
      bytes = bar (toread);
20
      if (bytes <= 0)
21
        {
22
          if (bytes < 0)
23
            continue;
24
          break;
25
        }
26
      toread -= bytes;
27
    }
28
 
29
  if (bytes == 0)
30
    eof_reached = 1;
31
}
32
 
33
 
34
/* First, we should simplify the bits < 0 test within the loop.  */
35
/* { dg-final { scan-tree-dump-times "Simplified relational" 1 "vrp1" } } */
36
 
37
/* Second, we should thread the edge out of the loop via the break
38
   statement.  */
39
/* { dg-final { scan-tree-dump-times "Threaded jump" 1 "vrp1" } } */
40
 
41
/* Now if we were really good, we'd realize that the final bytes == 0
42
   test is totally useless.  That's not likely to happen anytime soon.  */
43
 
44
/* { dg-final { cleanup-tree-dump "vrp1" } } */
45
 

powered by: WebSVN 2.1.0

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