| 1 |
/* PR rtl-optimization/116799 */ |
| 2 |
|
| 3 |
const char *l; |
| 4 |
|
| 5 |
__attribute__((noipa)) void |
| 6 |
foo (const char *x, const char *y, int z) |
| 7 |
{ |
| 8 |
if (x != l + 1 || y != x || z) |
| 9 |
__builtin_abort (); |
| 10 |
} |
| 11 |
|
| 12 |
__attribute__((noipa)) void |
| 13 |
bar (const char *x, char *v) |
| 14 |
{ |
| 15 |
const char *w = x + __builtin_strlen (x); |
| 16 |
|
| 17 |
while (x[0] == '*' && x < w - 1) |
| 18 |
x++; |
| 19 |
|
| 20 |
const char *y = w - 1; |
| 21 |
int z = 1; |
| 22 |
if (y >= x) |
| 23 |
{ |
| 24 |
while (y - x > 0 && *y == '*') |
| 25 |
y--; |
| 26 |
z = 0; |
| 27 |
} |
| 28 |
int i = 0; |
| 29 |
if (z) |
| 30 |
v[i++] = 'a'; |
| 31 |
v[i] = 'b'; |
| 32 |
foo (x, y, z); |
| 33 |
} |
| 34 |
|
| 35 |
int |
| 36 |
main () |
| 37 |
{ |
| 38 |
char v[2] = { 0 }; |
| 39 |
l = "**"; |
| 40 |
bar (l, v); |
| 41 |
} |