This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC/testsuite] detect ICE in testsuite, include in FAIL message


This patch detects internal compiler errors in GCC compiler tests and
reports them as failures, with no chance to make it an XFAIL.  So far
it supports at least C and Fortran tests; I haven't checked which other
languages use C testsuite support in the relevant areas.  I'm not
finished tweaking it, but before I do full testing I'd appreciate some
feedback from the people who have asked for this feature in the past.

In some cases there is a single FAIL message for an ICE; in others
there are additional FAIL messages because I don't remove the ICE
message from the compiler output, leading to "excess errors" failures.
That doesn't seem like a big deal since presumably new ICEs will be
fixed quickly.  Similarly I assume it's not a problem that we can't
XFAIL an ICE.

There seems to be some very old cruft in gcc-defs.exp and
fortran-torture.exp looking for messages containing "got fatal signal",
which apparently isn't used anywhere now; I only found it in protoize.c.
Unless I hear that it's useful I'll remove that and let it be detected
by the new ICE checks.

I've tested this by adding individual temporary tests known to ICE to
gcc.dg, gfortran.dg, and in the C and Fortran compile and execute
torture directories.

Comments?  If not it's going in after some more tweaking and testing.

2006-05-11  Janis Johnson  <janis187@us.ibm.com>

	* lib/gcc-dg.exp (gcc-dg-test-1): Fail for an ICE.
	* lib/gcc-defs.exp (${tool}_check_compile): Ditto.
	* lib/fortran-torture.exp (fortran-torture-compile): Ditto.
	(fortran-torture-execute): Ditto.

Index: gcc/testsuite/lib/gcc-dg.exp
===================================================================
--- gcc/testsuite/lib/gcc-dg.exp	(revision 113643)
+++ gcc/testsuite/lib/gcc-dg.exp	(working copy)
@@ -139,6 +139,14 @@
 
     set comp_output [$target_compile "$prog" "$output_file" "$compile_type" $options]
 
+    # Look for an internal compiler error, which sometimes masks the fact
+    # that we didn't get an expected error message.  An ICE always fails,
+    # there's no way to XFAIL it.
+    if [string match "*internal compiler error*" $comp_output] {
+	upvar 2 name name
+	fail "$name (internal compiler error)"
+    }
+
     if { $do_what == "repo" } {
 	set object_file "$output_file"
 	set output_file "[file rootname [file tail $prog]].exe"
Index: gcc/testsuite/lib/gcc-defs.exp
===================================================================
--- gcc/testsuite/lib/gcc-defs.exp	(revision 113643)
+++ gcc/testsuite/lib/gcc-defs.exp	(working copy)
@@ -34,6 +34,11 @@
 	return 0
     }
 
+    if [string match "*internal compiler error*" $gcc_output] then {
+	${tool}_fail $testcase "$option (internal compiler error)"
+	return 0
+    }
+
     # We shouldn't get these because of -w, but just in case.
     if [string match "*cc:*warning:*" $gcc_output] then {
 	warning "$testcase: (with warnings) $option"
Index: gcc/testsuite/lib/fortran-torture.exp
===================================================================
--- gcc/testsuite/lib/fortran-torture.exp	(revision 113643)
+++ gcc/testsuite/lib/fortran-torture.exp	(working copy)
@@ -87,6 +87,12 @@
 	return
     }
 
+    if [string match "*internal compiler error*" $comp_output] then {
+	gfortran_fail $testcase "$option (internal compiler error)"
+	catch { remote_file build delete $output }
+	return
+    }
+
     # We shouldn't get these because of -w, but just in case.
     if [string match "*95*:*warning:*" $comp_output] then {
 	warning "$testcase: (with warnings) $option"
@@ -204,6 +210,12 @@
 	    catch { remote_file build delete $executable }
 	    continue
 	}
+
+	if [string match "*internal compiler error*" $comp_output] then {
+	    gfortran_fail $testcase "$option (internal compiler error)"
+	    catch { remote_file build delete $executable }
+	    continue
+	}
 	
 	# We shouldn't get these because of -w, but just in case.
 	if [string match "*95*:*warning:*" $comp_output] then {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]