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 |
/* As a quality of implementation issue, we should not prevent inlining
|
/* As a quality of implementation issue, we should not prevent inlining
|
of function explicitly marked inline just because a label therein had
|
of function explicitly marked inline just because a label therein had
|
its address taken. */
|
its address taken. */
|
|
|
#ifndef NO_LABEL_VALUES
|
#ifndef NO_LABEL_VALUES
|
static void *ptr1, *ptr2;
|
static void *ptr1, *ptr2;
|
static int i = 1;
|
static int i = 1;
|
|
|
static __inline__ void doit(void **pptr, int cond)
|
static __inline__ void doit(void **pptr, int cond)
|
{
|
{
|
if (cond) {
|
if (cond) {
|
here:
|
here:
|
*pptr = &&here;
|
*pptr = &&here;
|
}
|
}
|
}
|
}
|
|
|
__attribute__ ((noinline))
|
__attribute__ ((noinline))
|
static void f(int cond)
|
static void f(int cond)
|
{
|
{
|
doit (&ptr1, cond);
|
doit (&ptr1, cond);
|
}
|
}
|
|
|
__attribute__ ((noinline))
|
__attribute__ ((noinline))
|
static void g(int cond)
|
static void g(int cond)
|
{
|
{
|
doit (&ptr2, cond);
|
doit (&ptr2, cond);
|
}
|
}
|
|
|
__attribute__ ((noinline))
|
__attribute__ ((noinline))
|
static void bar(void);
|
static void bar(void);
|
|
|
int main()
|
int main()
|
{
|
{
|
f (i);
|
f (i);
|
bar();
|
bar();
|
g (i);
|
g (i);
|
|
|
#ifdef __OPTIMIZE__
|
#ifdef __OPTIMIZE__
|
if (ptr1 == ptr2)
|
if (ptr1 == ptr2)
|
abort ();
|
abort ();
|
#endif
|
#endif
|
|
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
void bar(void) { }
|
void bar(void) { }
|
|
|
#else /* NO_LABEL_VALUES */
|
#else /* NO_LABEL_VALUES */
|
int main() { exit(0); }
|
int main() { exit(0); }
|
#endif
|
#endif
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.