This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] Add patch for debugging compiler ICEs.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>
- Cc: Jakub Jelinek <jakub at redhat 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>, <ian at airs dot com>, <dj at redhat dot com>
- Date: Thu, 18 Sep 2014 22:16:53 +0000
- Subject: Re: [PATCH 2/2] 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> <Pine dot LNX dot 4 dot 64 dot 1409101634020 dot 12853 at digraph dot polyomino dot org dot uk> <5411CBC7 dot 10706 at partner dot samsung dot com>
On Thu, 11 Sep 2014, Maxim Ostapenko wrote:
> In general, when cc1 or cc1plus ICE-es, we try to reproduce the bug by running
> compiler 3 times and comparing stderr and stdout on each attempt with
> respective ones that were gotten as the result of previous compiler run (we
> use temporary dump files to do this). If these files are identical, we add GCC
> configuration (e.g. target, configure options and version), compiler command
> line and preprocessed source code into last dump file, containing backtrace.
> Following Jakub's approach, we trigger ICE_EXIT_CODE instead of
> FATAL_EXIT_CODE in case of DK_FATAL error to differ ICEs from other fatal
> errors, so try_generate_repro routine will be able to run even if fatal_error
> occurred in compiler.
I still don't understand what's going on here with exit codes.
Suppose cc1 calls fatal_error (not for an ICE, not -Wfatal-errors - a
normal DK_FATAL arising from a call to fatal_error). What exit code does
it exit with? What path leads to that exit code? How does the driver
distinguish this from an ICE?
Suppose cc1 calls internal_error. What exit code does it exit with? What
path leads to that exit code? How does the driver distinguish this from a
call to fatal_error?
What about the above exit codes was different before the patch, that means
the driver ICE detection can only work given the diagnostic.c changes?
--
Joseph S. Myers
joseph@codesourcery.com