URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 324 |
Rev 384 |
/* builtin_return_address(n) with n>0 has always been troublesome ...
|
/* builtin_return_address(n) with n>0 has always been troublesome ...
|
especially when the S/390 packed stack layout comes into play. */
|
especially when the S/390 packed stack layout comes into play. */
|
|
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O3 -fno-optimize-sibling-calls -mbackchain -mpacked-stack -msoft-float" } */
|
/* { dg-options "-O3 -fno-optimize-sibling-calls -mbackchain -mpacked-stack -msoft-float" } */
|
|
|
void *addr1;
|
void *addr1;
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
void * __attribute__((noinline))
|
void * __attribute__((noinline))
|
foo1 ()
|
foo1 ()
|
{
|
{
|
addr1 = __builtin_return_address (2);
|
addr1 = __builtin_return_address (2);
|
}
|
}
|
|
|
void * __attribute__((noinline))
|
void * __attribute__((noinline))
|
foo2 ()
|
foo2 ()
|
{
|
{
|
foo1 ();
|
foo1 ();
|
}
|
}
|
|
|
void * __attribute__((noinline))
|
void * __attribute__((noinline))
|
foo3 ()
|
foo3 ()
|
{
|
{
|
foo2 ();
|
foo2 ();
|
}
|
}
|
|
|
void __attribute__((noinline))
|
void __attribute__((noinline))
|
bar ()
|
bar ()
|
{
|
{
|
void *addr2;
|
void *addr2;
|
|
|
foo3 ();
|
foo3 ();
|
asm volatile ("basr %0,0\n\t" : "=d" (addr2));
|
asm volatile ("basr %0,0\n\t" : "=d" (addr2));
|
/* basr is two bytes in length. */
|
/* basr is two bytes in length. */
|
if (addr2 - addr1 != 2)
|
if (addr2 - addr1 != 2)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
bar();
|
bar();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.