From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15779 invoked by alias); 10 Sep 2014 16:37:53 -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 15770 invoked by uid 89); 10 Sep 2014 16:37:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Sep 2014 16:37:51 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XRktt-0007mc-Sx from joseph_myers@mentor.com ; Wed, 10 Sep 2014 09:37:46 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 10 Sep 2014 17:37:44 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1XRktr-0005RV-Kt; Wed, 10 Sep 2014 16:37:43 +0000 Date: Wed, 10 Sep 2014 16:37:00 -0000 From: "Joseph S. Myers" To: Jakub Jelinek CC: Maxim Ostapenko , GCC Patches , Jeff Law , Yury Gribov , Slava Garbuzov , Maxim Ostapenko Subject: Re: [Ping v2][PATCH] Add patch for debugging compiler ICEs. In-Reply-To: <20140910045724.GB17454@tucnak.redhat.com> Message-ID: References: <53F357DF.6010103@partner.samsung.com> <53FEDAC2.9050306@partner.samsung.com> <20140910045724.GB17454@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2014-09/txt/msg00830.txt.bz2 On Wed, 10 Sep 2014, Jakub Jelinek wrote: > On Tue, Sep 09, 2014 at 10:51:23PM +0000, Joseph S. Myers wrote: > > On Thu, 28 Aug 2014, Maxim Ostapenko wrote: > > > > > diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c > > > index 0cc7593..67b8c5b 100644 > > > --- a/gcc/diagnostic.c > > > +++ b/gcc/diagnostic.c > > > @@ -492,7 +492,7 @@ diagnostic_action_after_output (diagnostic_context *context, > > > real_abort (); > > > diagnostic_finish (context); > > > fnotice (stderr, "compilation terminated.\n"); > > > - exit (FATAL_EXIT_CODE); > > > + exit (ICE_EXIT_CODE); > > > > Why? This is the case for fatal_error. FATAL_EXIT_CODE seems right for > > this, and ICE_EXIT_CODE wrong. > > So that the driver can understand the difference between an ICE and other > fatal errors (e.g. sorry etc.). > Users are typically using the driver and for them it matters what exit code > is returned from the driver, not from cc1/cc1plus etc. Well, I think the next revision of the patch submission needs more explanation in this area. What exit codes do cc1 and the driver now return for (normal error, fatal error, ICE), and what do they return after the patch, and how does the change to the fatal_error case avoid incorrect changes if either cc1 or the driver called fatal_error (as opposed to either cc1 or the driver having an ICE)? Maybe that explanation should be in the form of a comment on this exit call, explaining why the counterintuitive use of ICE_EXIT_CODE in the DK_FATAL case is correct. -- Joseph S. Myers joseph@codesourcery.com