From patchwork Wed Aug 16 18:24:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 802186 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-460452-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="bj3Cv0ay"; 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 3xXd7V6bGmz9t42 for ; Thu, 17 Aug 2017 04:25:24 +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=EKnPdLssmMzYSK9iSMhcuK2j4+P7NKVaO/vLjZ0axEvjZLwsZ9 t9hLJqA8k6nN5lWLnm5GFtFfeDokwfobYWZimDru50hLsRcHzXY9e7BZZlTfChz5 Tb0hpImSV/yM97qJjN/PiA9VUOlIaUzVlQn2PC5ZNx9Q/YGKvLUDyuq9c= 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=wmeO9sg1LAV++ds7YHKkx77J698=; b=bj3Cv0ayJktJ5SXebRYf dS1t7BnDqg8D05Frfc/ag8EF4eq0kUiW/LPL6D+3jubEwwMSQ4WnBCPvtmsMmuvj kLvFCGlTJkXgAHWm5we77GEvpBJXj5aX/p/jnUE9/UshAwRmq93H1oNRGXrb/7l4 R7uP4BPINuGSs2FbdSmvVvI= Received: (qmail 89849 invoked by alias); 16 Aug 2017 18:25:07 -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 89573 invoked by uid 89); 16 Aug 2017 18:24:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:2254, HX-Gm-Message-State:AHYfb5h, wot, H*RU:200 X-HELO: mail-yw0-f174.google.com Received: from mail-yw0-f174.google.com (HELO mail-yw0-f174.google.com) (209.85.161.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Aug 2017 18:24:29 +0000 Received: by mail-yw0-f174.google.com with SMTP id l82so27666202ywc.2 for ; Wed, 16 Aug 2017 11:24:14 -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=q7iIzyqsyPCiOJbm4co61vLePUV+tmgCzrcAo0VI488=; b=rtUOD8T9rHEaXxNfTQ+WarZvrBA8KVsYAqyZYGjGwavcLPkcFLFX3ZYkC1k4f7pSIB E/eurokcpi8gtkepSP096b9g3GRkDGJO1zelYgFxMn1fhtzCDrWJQadA2cf50evaTh6s ZrL1Cbg373JgXnNZn+tP+UNsx04eM7KY5BZC3U3Da6W9DVsq/A6tZHxA2KK7ADVmCSWd n4EZEQvDMHHhNjoZXfA5kakS4lbse5Vuhrl8cD72/Khum34v3mpPoZmpQ4VfWBgK35R5 pu8MFzC6wzG/MKznHiV4w1lT0cO6fBAuu2w8xZwSI31vZmoacf9odYTkx1+bFpXKxAAI 10kQ== X-Gm-Message-State: AHYfb5h/7aMCVseqPCkBYRkgnkBBEYUpkaRXABnbx8jHhHr98MMZ76tQ brV4aKBBcc0J4w== X-Received: by 10.129.62.24 with SMTP id l24mr2231012ywa.173.1502907851983; Wed, 16 Aug 2017 11:24:11 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::1:4ba4]) by smtp.googlemail.com with ESMTPSA id b195sm498436ywb.21.2017.08.16.11.24.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 11:24:11 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [PATCH] Further driver signal cleanup Message-ID: <758d5cd0-06c8-fa4a-e9f5-31089470b7bd@acm.org> Date: Wed, 16 Aug 2017 14:24:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 This, almost obvious, patch merges the older SIGPIPE conditional into the new switch I added. I found the FALLTHROUGH marker needed to be outside the #if, which was a little annoying. I changed the backtrace error message to also explicitly say it was a signal wot did it. ok? nathan Index: gcc.c =================================================================== --- gcc.c (revision 251119) +++ gcc.c (working copy) @@ -3135,44 +3135,45 @@ execute (void) int status = statuses[i]; if (WIFSIGNALED (status)) - { + switch (WTERMSIG (status)) + { + case SIGINT: + case SIGQUIT: + case SIGKILL: + 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); + break; + #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 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) { - case SIGINT: - case SIGQUIT: - case SIGKILL: - 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); + 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) {