From: Andrea Corallo Date: Tue, 27 Sep 2022 14:20:28 +0000 (+0200) Subject: Don't ICE running selftests if errors were raised [PR99723] X-Git-Tag: basepoints/gcc-14~4006 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=248c8aeebc49aae3fd96bd587367d12e7c8b3c3a;p=thirdparty%2Fgcc.git Don't ICE running selftests if errors were raised [PR99723] Hi all this is to address PR 99723. In the PR GCC crashes as the initialization of common trees is not performed as no compilation is happening, this is because we raise an error earlier while processing the arch flags. This patch changes the code to execute selftests only if no errors where raised before. Bootstrapped on aarch64, okay for trunk? Best Regards Andrea 2022-09-27 Andrea Corallo PR other/99723 * toplev.cc (toplev::main): Don't run self tests in case of previous error. --- diff --git a/gcc/toplev.cc b/gcc/toplev.cc index 924871fa9a87..b53a78bbaf17 100644 --- a/gcc/toplev.cc +++ b/gcc/toplev.cc @@ -2276,7 +2276,7 @@ toplev::main (int argc, char **argv) start_timevars (); do_compile (no_backend); - if (flag_self_test) + if (flag_self_test && !seen_error ()) { if (no_backend) error_at (UNKNOWN_LOCATION, "self-tests incompatible with %<-E%>");