From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31933 invoked by alias); 21 Oct 2013 18:32:42 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 31906 invoked by uid 89); 21 Oct 2013 18:32:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com From: David Malcolm To: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org Cc: David Malcolm Subject: [jit] Fix error-handling within gcc::jit::context::compile (timevar issues) Date: Tue, 01 Jan 2013 00:00:00 -0000 Message-Id: <1382380337-22512-1-git-send-email-dmalcolm@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-SW-Source: 2013-q4/txt/msg00021.txt.bz2 Committed to dmalcolm/jit: gcc/jit/ * internal-api.c (gcc::jit::context::compile): Correctly cleanup timevars in error-handling, preventing an issue where an error on a context left timevar.c in an unstopped state, leading to an assertion failure when restarting timevars in the next compile. Found via fuzz-testing. --- gcc/jit/ChangeLog.jit | 8 ++++++++ gcc/jit/internal-api.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit index adf273b..2cf5c8d 100644 --- a/gcc/jit/ChangeLog.jit +++ b/gcc/jit/ChangeLog.jit @@ -1,5 +1,13 @@ 2013-10-21 David Malcolm + * internal-api.c (gcc::jit::context::compile): Correctly cleanup + timevars in error-handling, preventing an issue where an error + on a context left timevar.c in an unstopped state, leading to an + assertion failure when restarting timevars in the next compile. + Found via fuzz-testing. + +2013-10-21 David Malcolm + * internal-api.c (gcc::jit::context::postprocess): Show source line numbers (if any) in gimple dump. diff --git a/gcc/jit/internal-api.c b/gcc/jit/internal-api.c index 8bb6741..d90f001 100644 --- a/gcc/jit/internal-api.c +++ b/gcc/jit/internal-api.c @@ -1261,7 +1261,11 @@ compile () active_jit_ctxt = NULL; if (errors_occurred ()) - goto error; + { + timevar_stop (TV_TOTAL); + timevar_print (stderr); + goto error; + } timevar_push (TV_ASSEMBLE); @@ -1279,7 +1283,12 @@ compile () printf ("cmd: %s\n", cmd); int ret = system (cmd); if (ret) - goto error; + { + timevar_pop (TV_ASSEMBLE); + timevar_stop (TV_TOTAL); + timevar_print (stderr); + goto error; + } } timevar_pop (TV_ASSEMBLE); -- 1.7.11.7