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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [g++.dg/] [tree-ssa/] [pr18178.C] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-vrp" } */
3
 
4
// Define this to see it work.
5
// #define WORK_WORK_WORK
6
 
7
#define THIRD
8
 
9
#ifdef THIRD
10
#define FIRST  i < 0 ||
11
#define ORIG int
12
#define CAST
13
#else
14
 
15
#define FIRST
16
#ifdef WORK_WORK_WORK
17
#define ORIG unsigned int
18
#define CAST
19
#else
20
#define ORIG int
21
#define CAST (unsigned)
22
#endif // WORK_WORK_WORK
23
 
24
#endif // THIRD
25
 
26
struct array
27
{
28
  const ORIG len;
29
  int *data;
30
};
31
 
32
extern void call (ORIG);
33
 
34
void doit (array *a)
35
{
36
  for (ORIG i = 0; i < a->len; ++i)
37
    {
38
      if (FIRST  CAST (i) >= CAST (a->len))
39
        throw 5;
40
      call (a->data[i]);
41
    }
42
}
43
 
44
/* VRP should remove all but 1 if() in the loop.  */
45
 
46
/* { dg-final { scan-tree-dump-times "if " 1 "vrp"} } */
47
/* { dg-final { cleanup-tree-dump "vrp" } } */

powered by: WebSVN 2.1.0

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