URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
int a;
|
int a;
|
int b[100];
|
int b[100];
|
void abort (void);
|
void abort (void);
|
|
|
inline void
|
inline void
|
cold_function ()
|
cold_function ()
|
{
|
{
|
int i;
|
int i;
|
for (i = 0; i < 99; i++)
|
for (i = 0; i < 99; i++)
|
if (b[i] / (b[i+1] + 1))
|
if (b[i] / (b[i+1] + 1))
|
abort ();
|
abort ();
|
}
|
}
|
|
|
inline void
|
inline void
|
hot_function ()
|
hot_function ()
|
{
|
{
|
int i;
|
int i;
|
for (i = 0; i < 99; i++)
|
for (i = 0; i < 99; i++)
|
if (b[i] / (b[i+1] + 1))
|
if (b[i] / (b[i+1] + 1))
|
abort ();
|
abort ();
|
}
|
}
|
|
|
main ()
|
main ()
|
{
|
{
|
if (a)
|
if (a)
|
cold_function ();
|
cold_function ();
|
else
|
else
|
hot_function ();
|
hot_function ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
/* cold function should be inlined, while hot function should not.
|
/* cold function should be inlined, while hot function should not.
|
Look for "cold_function () [tail call];" call statement not for the
|
Look for "cold_function () [tail call];" call statement not for the
|
declaration or other apperances of the string in dump. */
|
declaration or other apperances of the string in dump. */
|
/* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
|
/* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */
|
/* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
|
/* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */
|
/* { dg-final-use { cleanup-tree-dump "optimized" } } */
|
/* { dg-final-use { cleanup-tree-dump "optimized" } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.