From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129273 invoked by alias); 28 Aug 2017 13:51:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 127837 invoked by uid 89); 28 Aug 2017 13:51:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=killer, sidwell, Sidwell X-HELO: mail-yw0-f182.google.com Received: from mail-yw0-f182.google.com (HELO mail-yw0-f182.google.com) (209.85.161.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 28 Aug 2017 13:51:23 +0000 Received: by mail-yw0-f182.google.com with SMTP id s143so2769981ywg.0 for ; Mon, 28 Aug 2017 06:51:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=VtlNQYzVMVjdV/iLhapzpADtyi9lJOb61Ccza82vRtE=; b=ZsvwC66i99D5cmlKsQZylMDwXjin3ZXcnO1PuyiDAtIUA4nPJvmm0kXhgq2tzFMFk4 x3ZNiT/c4XCw5Drrp+AGFuD2LUrJxtYTtMwX7eSGfHPKY42oWeILYRl0WWzozo/JYJkh Nimn5M6cDNtWOxD+cgrnz0++s/3Fq/tzObFpFi/+mwk9coHU7gn6STA2PNXhfjhzWV3f xrm4yhnLXaTL/wYSPQ45joPsTzs4oy08ZZDSQ/e/mzHdxl63AZ7j8xqHTf4K5+3rtiWU XqyIETOMzo452U3pltfakVljjyzQypsB194xwgW4Cuow11SYgdm/MNDbVVvkLmqQkNRy x7jA== X-Gm-Message-State: AHYfb5i88prhjqoupHrhQaUdzfP5iVxr3DbL9tAPvjAojjr1PFqq3mWE jjXwbIpuN/8YTw== X-Received: by 10.37.17.6 with SMTP id 6mr554663ybr.312.1503928281860; Mon, 28 Aug 2017 06:51:21 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::1:d19a]) by smtp.googlemail.com with ESMTPSA id q125sm165478ywg.34.2017.08.28.06.51.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 06:51:21 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [PATCH] small gcc.c cleanup Message-ID: Date: Mon, 28 Aug 2017 15:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------DE7EA8D2C38C0A571F8E2325" X-SW-Source: 2017-08/txt/msg01582.txt.bz2 This is a multi-part message in MIME format. --------------DE7EA8D2C38C0A571F8E2325 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 165 I committed this update to my post of https://gcc.gnu.org/ml/gcc-patches/2017-08/msg01011.html, deciding it now sufficiently obvious :) nathan -- Nathan Sidwell --------------DE7EA8D2C38C0A571F8E2325 Content-Type: text/x-patch; name="gcc-switch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcc-switch.diff" Content-length: 3119 2017-08-28 Nathan Sidwell * gcc.c (execute): Fold SIGPIPE handling into switch statement. Adjust internal error message. Index: gcc.c =================================================================== --- gcc.c (revision 251380) +++ gcc.c (working copy) @@ -3135,49 +3135,50 @@ execute (void) int status = statuses[i]; if (WIFSIGNALED (status)) - { -#ifdef SIGPIPE - /* SIGPIPE is a special case. It happens in -pipe mode - when the compiler dies before the preprocessor is done, - or the assembler dies before the compiler is done. - There's generally been an error already, and this is - just fallout. So don't generate another error unless - we would otherwise have succeeded. */ - if (WTERMSIG (status) == SIGPIPE - && (signal_count || greatest_status >= MIN_FATAL_STATUS)) - { - signal_count++; - ret_code = -1; - } - else -#endif - switch (WTERMSIG (status)) - { - case SIGINT: - /* SIGQUIT and SIGKILL are not available on MinGW. */ + switch (WTERMSIG (status)) + { + case SIGINT: + case SIGTERM: + /* SIGQUIT and SIGKILL are not available on MinGW. */ #ifdef SIGQUIT - case SIGQUIT: + case SIGQUIT: #endif #ifdef SIGKILL - case SIGKILL: + case SIGKILL: #endif - case SIGTERM: - /* The user (or environment) did something to the - inferior. Making this an ICE confuses the user - into thinking there's a compiler bug. Much more - likely is the user or OOM killer nuked it. */ - fatal_error (input_location, - "%s signal terminated program %s", - strsignal (WTERMSIG (status)), - commands[i].prog); + /* The user (or environment) did something to the + inferior. Making this an ICE confuses the user into + thinking there's a compiler bug. Much more likely is + the user or OOM killer nuked it. */ + fatal_error (input_location, + "%s signal terminated program %s", + strsignal (WTERMSIG (status)), + commands[i].prog); + break; + +#ifdef SIGPIPE + case SIGPIPE: + /* SIGPIPE is a special case. It happens in -pipe mode + when the compiler dies before the preprocessor is + done, or the assembler dies before the compiler is + done. There's generally been an error already, and + this is just fallout. So don't generate another + error unless we would otherwise have succeeded. */ + if (signal_count || greatest_status >= MIN_FATAL_STATUS) + { + signal_count++; + ret_code = -1; break; - default: - /* The inferior failed to catch the signal. */ - internal_error_no_backtrace ("%s (program %s)", - strsignal (WTERMSIG (status)), - commands[i].prog); } - } +#endif + /* FALLTHROUGH */ + + default: + /* The inferior failed to catch the signal. */ + internal_error_no_backtrace ("%s signal terminated program %s", + strsignal (WTERMSIG (status)), + commands[i].prog); + } else if (WIFEXITED (status) && WEXITSTATUS (status) >= MIN_FATAL_STATUS) { --------------DE7EA8D2C38C0A571F8E2325--