URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* PR rtl-optimization/20017
|
/* PR rtl-optimization/20017
|
|
|
After CSE/GCSE folds a switch statement to an unconditional jump,
|
After CSE/GCSE folds a switch statement to an unconditional jump,
|
cfg_cleanup did not remove a dead jump table, confusing the CFG
|
cfg_cleanup did not remove a dead jump table, confusing the CFG
|
layout code later on. */
|
layout code later on. */
|
|
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-O1" } */
|
/* { dg-options "-O1" } */
|
/* { dg-options "-O1 -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
|
/* { dg-options "-O1 -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
|
|
|
int
|
int
|
foo (int *buf, int *p)
|
foo (int *buf, int *p)
|
{
|
{
|
int result;
|
int result;
|
const int *tmp;
|
const int *tmp;
|
|
|
if (*buf)
|
if (*buf)
|
return 1;
|
return 1;
|
|
|
result = 2;
|
result = 2;
|
*buf = 2;
|
*buf = 2;
|
tmp = buf;
|
tmp = buf;
|
switch (*tmp)
|
switch (*tmp)
|
{
|
{
|
case 3:
|
case 3:
|
case 4:
|
case 4:
|
case 6:
|
case 6:
|
case 14:
|
case 14:
|
return 1;
|
return 1;
|
|
|
case 0:
|
case 0:
|
result = *p;
|
result = *p;
|
|
|
/* Fall through. */
|
/* Fall through. */
|
default:
|
default:
|
if (result)
|
if (result)
|
return 1;
|
return 1;
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.