Currently IL verification errors trigger "confused by earlier errors" messages with a release compiler but compiling with -fchecking. That is because those use error() before internal_error.
This precludes useful things like emergency IL dump in dump files. Thus the following - change CHECKING_P to flag_checking. Any objections? Bootstrap & regtest running on x86_64-unkown-linux-gnu. Richard. 2019-12-05 Richard Biener <rguent...@suse.de> * diagnostic.c: Include options.h. (diagnostic_report_diagnostic): Enable ICEs after errors with -fchecking. Index: gcc/diagnostic.c =================================================================== --- gcc/diagnostic.c (revision 278963) +++ gcc/diagnostic.c (working copy) @@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. #include "selftest.h" #include "selftest-diagnostic.h" #include "opts.h" +#include "options.h" #ifdef HAVE_TERMIOS_H # include <termios.h> @@ -1023,7 +1024,7 @@ diagnostic_report_diagnostic (diagnostic /* When not checking, ICEs are converted to fatal errors when an error has already occurred. This is counteracted by abort_on_error. */ - if (!CHECKING_P + if (!flag_checking && (diagnostic_kind_count (context, DK_ERROR) > 0 || diagnostic_kind_count (context, DK_SORRY) > 0) && !context->abort_on_error)