From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2092) id CEF433858284; Mon, 10 Oct 2022 13:22:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CEF433858284 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665408179; bh=n9LNDRCRtofLENAGEi0a8xN1NVtYVsE1GOc8vVgYR5o=; h=From:To:Subject:Date:From; b=v43NVlkH4/GHxf4nPqeOxjJ8jWDbWnvbXWXtaExs0DXnEp+Ljl1bA37mLCeh9CfPS XZdEzWWmWl5iJBtCQYPh4UzBUabtSTeLEuB8b6qHsn9dQdZweWRTix2Cfb2ysGF4lU hUONxaszKZvdgdMiYe/YMQ8u41QmWII0YIswophs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Andrea Corallo To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3201] Don't ICE running selftests if errors were raised [PR99723] X-Act-Checkin: gcc X-Git-Author: Andrea Corallo X-Git-Refname: refs/heads/trunk X-Git-Oldrev: d0bbecb1c418b680505faa998fe420f0fd4bbfc1 X-Git-Newrev: 248c8aeebc49aae3fd96bd587367d12e7c8b3c3a Message-Id: <20221010132259.CEF433858284@sourceware.org> Date: Mon, 10 Oct 2022 13:22:59 +0000 (GMT) List-Id: https://gcc.gnu.org/g:248c8aeebc49aae3fd96bd587367d12e7c8b3c3a commit r13-3201-g248c8aeebc49aae3fd96bd587367d12e7c8b3c3a Author: Andrea Corallo Date: Tue Sep 27 16:20:28 2022 +0200 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: --- gcc/toplev.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/toplev.cc b/gcc/toplev.cc index 924871fa9a8..b53a78bbaf1 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%>");