URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-O2 -fdump-tree-vrp1" } */
|
/* { dg-options "-O2 -fdump-tree-vrp1" } */
|
|
|
// Define this to see it work.
|
// Define this to see it work.
|
// #define WORK_WORK_WORK
|
// #define WORK_WORK_WORK
|
|
|
#define THIRD
|
#define THIRD
|
|
|
#ifdef THIRD
|
#ifdef THIRD
|
#define FIRST i < 0 ||
|
#define FIRST i < 0 ||
|
#define ORIG int
|
#define ORIG int
|
#define CAST
|
#define CAST
|
#else
|
#else
|
|
|
#define FIRST
|
#define FIRST
|
#ifdef WORK_WORK_WORK
|
#ifdef WORK_WORK_WORK
|
#define ORIG unsigned int
|
#define ORIG unsigned int
|
#define CAST
|
#define CAST
|
#else
|
#else
|
#define ORIG int
|
#define ORIG int
|
#define CAST (unsigned)
|
#define CAST (unsigned)
|
#endif // WORK_WORK_WORK
|
#endif // WORK_WORK_WORK
|
|
|
#endif // THIRD
|
#endif // THIRD
|
|
|
struct array
|
struct array
|
{
|
{
|
const ORIG len;
|
const ORIG len;
|
int *data;
|
int *data;
|
};
|
};
|
|
|
extern void call (ORIG);
|
extern void call (ORIG);
|
|
|
void doit (array *a)
|
void doit (array *a)
|
{
|
{
|
for (ORIG i = 0; i < a->len; ++i)
|
for (ORIG i = 0; i < a->len; ++i)
|
{
|
{
|
if (FIRST CAST (i) >= CAST (a->len))
|
if (FIRST CAST (i) >= CAST (a->len))
|
throw 5;
|
throw 5;
|
call (a->data[i]);
|
call (a->data[i]);
|
}
|
}
|
}
|
}
|
|
|
/* VRP should remove all but 1 if() in the loop. */
|
/* VRP should remove all but 1 if() in the loop. */
|
|
|
/* { dg-final { scan-tree-dump-times "if " 1 "vrp1"} } */
|
/* { dg-final { scan-tree-dump-times "if " 1 "vrp1"} } */
|
/* { dg-final { cleanup-tree-dump "vrp1" } } */
|
/* { dg-final { cleanup-tree-dump "vrp1" } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.