| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-foptimize-sibling-calls" } */ |
| 3 |
/* { dg-final { scan-assembler {brasl\t%r\d+,bar4} } } */ |
| 4 |
/* { dg-final { scan-assembler {brasl\t%r\d+,bar8} } } */ |
| 5 |
|
| 6 |
/* Parameter E is passed in GPR 6 which is call-saved which prohibits |
| 7 |
sibling call optimization. This must hold true also if the mode of the |
| 8 |
parameter is BLKmode. */ |
| 9 |
|
| 10 |
/* 4 byte */ |
| 11 |
|
| 12 |
typedef struct |
| 13 |
{ |
| 14 |
char x; |
| 15 |
char y[3]; |
| 16 |
} t4; |
| 17 |
|
| 18 |
extern t4 e4; |
| 19 |
|
| 20 |
extern void bar4 (int a, int b, int c, int d, t4 e4); |
| 21 |
|
| 22 |
void foo4 (int a, int b, int c, int d) |
| 23 |
{ |
| 24 |
bar4 (a, b, c, d, e4); |
| 25 |
} |
| 26 |
|
| 27 |
/* 8 byte */ |
| 28 |
|
| 29 |
typedef struct |
| 30 |
{ |
| 31 |
short x; |
| 32 |
char y[6]; |
| 33 |
} t8; |
| 34 |
|
| 35 |
extern t8 e8; |
| 36 |
|
| 37 |
extern void bar8 (int a, int b, int c, int d, t8 e8); |
| 38 |
|
| 39 |
void foo8 (int a, int b, int c, int d) |
| 40 |
{ |
| 41 |
bar8 (a, b, c, d, e8); |
| 42 |
} |