From patchwork Mon Aug 28 13:51:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 806584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-461019-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Us1nK2ja"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xgtV10MM2z9sNq for ; Mon, 28 Aug 2017 23:51:36 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=AvF1IQn2n45nFjO0cJXWClKz25BZuPx8PZP25c/UL43Hg78dOY MhTaVleYMNsJm5s5j4KwQ1kJOUClZDuqh5ZRq3kw6LIVdFxgIQBHu7QOkH1OO7tr tRhNxX8ISKIDhMKG1gh8859ZtDqtKhlzxsvuq3tcxOGGJUn7p++ygOL2Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=jGekrWjducK2E7NZPYOuBHZdcVQ=; b=Us1nK2jaXKEsh6m3N9cm cNRYI8yOQ9/OXu3OAvcOPqtif5MUQMKMJRmL/HqXfnbqquPwVs9MAKUJKFE+l4PX XDXveXJXgby7431hUXZewNyhmCsG4nye+PfLjQ6vg0RaToQ58oOzO3AKsNeY14Ra ixr3gcepAedPr3Tw6+rIXWU= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 09:51:19 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 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 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) {