This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Ping v2][PATCH] Add patch for debugging compiler ICEs.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jeff Law <law at redhat dot com>, Yury Gribov <y dot gribov at samsung dot com>, Slava Garbuzov <v dot garbuzov at samsung dot com>, Maxim Ostapenko <chefmax7 at gmail dot com>
- Date: Wed, 10 Sep 2014 16:37:43 +0000
- Subject: Re: [Ping v2][PATCH] Add patch for debugging compiler ICEs.
- Authentication-results: sourceware.org; auth=none
- References: <53F357DF dot 6010103 at partner dot samsung dot com> <53FEDAC2 dot 9050306 at partner dot samsung dot com> <Pine dot LNX dot 4 dot 64 dot 1409092243040 dot 19877 at digraph dot polyomino dot org dot uk> <20140910045724 dot GB17454 at tucnak dot redhat dot com>
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