URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// PR optimization/13067
|
// PR optimization/13067
|
// Origin:
|
// Origin:
|
|
|
// This used to fail on the tree-ssa because of "out-of-ssa"
|
// This used to fail on the tree-ssa because of "out-of-ssa"
|
// We might have a valid variable, but not a valid value when trying to find
|
// We might have a valid variable, but not a valid value when trying to find
|
// useless statements created by out-of-ssa translation. In this case
|
// useless statements created by out-of-ssa translation. In this case
|
// val will be set to null, then later dereferenced. Bad.
|
// val will be set to null, then later dereferenced. Bad.
|
|
|
// { dg-do compile }
|
// { dg-do compile }
|
// { dg-options "-Os" }
|
// { dg-options "-Os" }
|
|
|
|
|
|
|
struct Iterator
|
struct Iterator
|
{
|
{
|
Iterator operator++();
|
Iterator operator++();
|
};
|
};
|
|
|
void GetChar(char* aChar);
|
void GetChar(char* aChar);
|
|
|
void foo(char aChar)
|
void foo(char aChar)
|
{
|
{
|
char quote;
|
char quote;
|
Iterator end;
|
Iterator end;
|
|
|
while (1) {
|
while (1) {
|
if (aChar == '"')
|
if (aChar == '"')
|
GetChar(&aChar);
|
GetChar(&aChar);
|
|
|
switch (aChar) {
|
switch (aChar) {
|
case 'a':
|
case 'a':
|
++end;
|
++end;
|
if (quote) {
|
if (quote) {
|
if (quote == aChar) {
|
if (quote == aChar) {
|
quote = 0;
|
quote = 0;
|
}
|
}
|
} else {
|
} else {
|
quote = aChar;
|
quote = aChar;
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
}
|
|
|
|
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.