Add strace debugging aid.
1 --- /dev/null Sat Dec 14 13:56:51 2002
2 +++ gcc-3.3.1/gcc/testsuite/gcc.dg/pr10392-1.c Sun Sep 14 14:28:24 2003
4 +/* PR optimization/10392
5 + * Reporter: marcus@mc.pp.se
6 + * Summary: [3.3/3.4 regression] [SH] optimizer generates faulty array indexing
8 + * The address calculation of an index operation on an array on the stack
9 + * can _under some conditions_ get messed up completely
11 + * Testcase tweaked by dank@kegel.com
12 + * Problem only happens with -O2 -m4, so it should only happen on sh4,
13 + * but what the heck, let's test other architectures, too.
14 + * Not marked as xfail since it's a regression.
17 +/* { dg-options "-O2" } */
18 +/* { dg-options "-O2 -m4" { target sh4-*-* } } */
19 +const char *dont_optimize_function_away;
21 +const char *use(const char *str)
23 + dont_optimize_function_away = str;
26 + if (str[1] < '1' || str[1] > '6')
30 + return str[2] ? "notused" : "v6";
33 +const char *func(char *a, char *b)
48 + for (i = 0; i < 2; i++) {
49 + /* bug is: following line passes wild pointer to use() on sh4 -O2 */
50 + result = use(item[i]);
55 + result = use(result);