Testsuite suggestions
Rodney Brown
rdb@localhost
Wed Mar 22 14:43:00 GMT 2000
Bootstrapping gcc and running the testsuite is something that may
be done without copyright assignment.
In doing so what best supports the developers?
Obviously frequent builds from the CVS.
--enable-checking builds?
Builds on particular platforms that increase test coverage
ie AIX => PowerPC, XCOFF HP-UX => HPPA, SOM
Some suggestions :-
Assumption:
Developers would rather debug a problem in a testsuite case than
in a compiler source file, and the pattern of testsuite failures may
better pinpoint a problem than a single failure in the gcc source.
Internal compiler errors compiling gcc source at -O2 usually don't
recur compiling without optimization.
=>
Re-issue compile without optimization. (See enclosed patch at end)
This has also allowed --enable-checking builds when process size limits
kill optimized compiles of some of the source.
Assumption:
Extending the testsuite to step through compatible architectural
subvarients will usefully improve coverage.
ie i686 => i586 => i486 => i386
alphaev6 => alpha
hppa2.0 => hppa1.1 => hppa1.0
=>
Dejagnu configuration changes? Complications for OSes where there is a
minimum assumed varient (Unixware7 assumes i586 for example).
Assumption:
i?86-*-linux* provides the most cost effective, hence most easily
available space & cycles for developers/testers.
The linux iBCS kernel module can allow Unixware 7, Solaris (x86)
and maybe FreeBSD (x86) binaries to run.
Alternately binutils supports assembling and linking dwarf or dwarf2
binaries.
=>
Subject to licensing, Unixware 7, Solaris x86 and FreeBSD
compilers could be bootstrapped & tested on linux, using respective
header files, assemblers and linkers etc.
Assuming binutils adequately supports dwarf2, a linux dwarf2 build
could cover similar ground (at least for Unixware 7).
Unixware 7 & IRIX seem to be the 'common' dwarf2 platforms - and
experience breakage on snapshot builds more often than more common
platforms. A linux hosted dwarf2 environment, however accomplished
should reduce developer time supporting dwarf2.
Without copyright assignment, the following patch is academic.
It should also, use a command-line flag rather than a hacky
enviroment variable, assert that the failure is happening in
cc1, cc1plus or f771 and temporarily turn on the verbose flag
for the repeated command (or maybe just print out the failing
command line). Consistently following the coding standard would
help too.
--- gcc.c.orig Thu Feb 3 22:44:24 2000
+++ gcc.c Fri Feb 18 08:43:34 2000
@@ -2435,6 +2435,38 @@
}
}
+static int
+retry_candidate(argv, n_commands)
+ char **argv;
+ int n_commands;
+{
+ if (!save_temps_flag && n_commands == 1 && argv != NULL
+ && getenv("ICE_RETRY") != NULL)
+ {
+ int i;
+
+ for (i = 0; argv[i] != NULL; i++)
+ if (strncmp(argv[i], "-O", 2) == 0)
+ return 1;
+ }
+ return 0;
+}
+
+static char **
+new_argv_nooptimize(argv)
+ char **argv;
+{
+ char **n_argv;
+ int i, j;
+
+ n_argv = (char **) xmalloc (argbuf_index * sizeof (char *));
+ for (i = j = 0; argv[i] != NULL; i++)
+ if (strncmp(argv[i], "-O", 2) != 0)
+ n_argv[j++] = argv[i];
+
+ n_argv[j] = NULL;
+ return n_argv;
+}
/* Execute the command specified by the arguments on the current line of spec.
When using pipes, this includes several piped-together commands
@@ -2447,6 +2479,7 @@
{
int i;
int n_commands; /* # of command. */
+ int in_retry = 0; /* retrying failed command */
char *string;
struct command
{
@@ -2496,6 +2529,8 @@
/* If -v, print what we are about to do, and maybe query. */
+ do {
+ in_retry = 0;
if (verbose_flag)
{
/* For help listings, put a blank line between sub-processes. */
@@ -2547,9 +2582,6 @@
if (commands[i].pid == -1)
pfatal_pexecute (errmsg_fmt, errmsg_arg);
-
- if (string != commands[i].prog)
- free (string);
}
execution_count++;
@@ -2606,26 +2638,52 @@
{
fatal ("Internal compiler error: program %s got fatal signal %d",
commands[j].prog, WTERMSIG (status));
+ if (retry_candidate (commands[j].argv, n_commands))
+ {
+ in_retry = 1;
+ commands[j].argv =
+ new_argv_nooptimize(commands[j].argv);
+ }
+ else
+ {
signal_count++;
ret_code = -1;
}
+ }
else if (WIFEXITED (status)
&& WEXITSTATUS (status) >= MIN_FATAL_STATUS)
{
+ if (retry_candidate (commands[j].argv, n_commands))
+ {
+ in_retry = 1;
+ commands[j].argv =
+ new_argv_nooptimize(commands[j].argv);
+ }
+ else
+ {
if (WEXITSTATUS (status) > greatest_status)
greatest_status = WEXITSTATUS (status);
ret_code = -1;
}
}
+ }
#ifdef HAVE_GETRUSAGE
if (report_times && ut + st != 0)
notice ("# %s %.2f %.2f\n", commands[j].prog, ut, st);
#endif
+ if (!in_retry && commands[j].argv[0] != commands[j].prog)
+ free (commands[j].argv[0]);
break;
}
}
+ if (!in_retry)
+ {
+ if (commands[0].argv != &argbuf[0])
+ free(commands[0].argv);
return ret_code;
}
+ }
+ } while (in_retry);
}
/* Find all the switches given to us
More information about the Gcc
mailing list