| 1 |
/* PR rtl-optimization/16536 |
| 2 |
Origin: Jeremy Denise <[email protected]> |
| 3 |
Reduced: Wolfgang Bangerth <[email protected]> |
| 4 |
Volker Reichelt <[email protected]> */ |
| 5 |
/* { dg-options "-fgnu89-inline" } */ |
| 6 |
|
| 7 |
extern void abort (); |
| 8 |
|
| 9 |
typedef struct |
| 10 |
{ |
| 11 |
int i, dummy; |
| 12 |
} A; |
| 13 |
|
| 14 |
inline A foo (const A* p, const A* q) |
| 15 |
{ |
| 16 |
return (A){p->i+q->i}; |
| 17 |
} |
| 18 |
|
| 19 |
void bar (A* __restrict__ p) |
| 20 |
{ |
| 21 |
*p=foo(p,p); |
| 22 |
if (p->i!=2) |
| 23 |
abort(); |
| 24 |
} |
| 25 |
|
| 26 |
int main () |
| 27 |
{ |
| 28 |
A a={1}; |
| 29 |
bar(&a); |
| 30 |
return 0; |
| 31 |
} |