From patchwork Tue Jun 30 19:32:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 489790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 5BAF714030A for ; Wed, 1 Jul 2015 05:19:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=jiXcRp6J; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=yxXQB6ItFYi+ 8W10Vjb2QrOnJwEhgNZbwja2qfX2VA7HHC/PTlKxDcJzZ/TXT6KxNOJNstfKe01y 8tzau6C1hNd6pjRRIKTlemgYeGr6oB87QI6bE6V5Zv8va30xyEo/kXG6ssZw4oje MfQFh0qjjxUuO0bKIAuD5ywrre31gUE= 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:from :to:cc:subject:date:message-id; s=default; bh=bhwWvZMXt8VzfoYg5U vRBC1m2nI=; b=jiXcRp6JB5JI6g0r+n+GeimtgvEFTU4LVwUAw7CqVcLgx/42LG Y05mkv9x9JMCR0MlJm74SW639LE4YxmOZ3zZf+i2rhhLNoUBJaseko+LY5ENcX5E W0468JE7OTg5DplJaUPTA18rvXww3Xgqaf8eLGZUAq3/h855UjNDkqP7k= Received: (qmail 119328 invoked by alias); 30 Jun 2015 19:19:13 -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 119308 invoked by uid 89); 30 Jun 2015 19:19:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 30 Jun 2015 19:19:12 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 26F81B8BDF; Tue, 30 Jun 2015 19:19:11 +0000 (UTC) Received: from c64.redhat.com (vpn-232-166.phx2.redhat.com [10.3.232.166]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5UJJAe2022283; Tue, 30 Jun 2015 15:19:10 -0400 From: David Malcolm To: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH, committed] fixes to gcc_jit_context_dump_reproducer_to_file Date: Tue, 30 Jun 2015 15:32:30 -0400 Message-Id: <1435692750-16780-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes Tested with "make check-jit" and visual inspection; jit.sum continues to have 8014 passes. Committed to trunk as r225204. gcc/jit/ChangeLog: * jit-recording.c (gcc::jit::recording::context::dump_reproducer_to_file): Add pragma to generated reproducers to disable -Wunused-variable. Fix handling of NULL string options. --- gcc/jit/jit-recording.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/jit/jit-recording.c b/gcc/jit/jit-recording.c index f379b58..11b9739 100644 --- a/gcc/jit/jit-recording.c +++ b/gcc/jit/jit-recording.c @@ -1494,6 +1494,7 @@ recording::context::dump_reproducer_to_file (const char *path) print_version (r.get_file (), " ", false); r.write ("*/\n"); r.write ("#include \n\n"); + r.write ("#pragma GCC diagnostic ignored \"-Wunused-variable\"\n\n"); r.write ("static void\nset_options ("); r.write_params (contexts); r.write (");\n\n"); @@ -1564,12 +1565,17 @@ recording::context::dump_reproducer_to_file (const char *path) r.write (" /* String options. */\n"); for (int opt_idx = 0; opt_idx < GCC_JIT_NUM_STR_OPTIONS; opt_idx++) - r.write (" gcc_jit_context_set_str_option (%s,\n" - " %s,\n" - " \"%s\");\n", - r.get_identifier (contexts[ctxt_idx]), - str_option_reproducer_strings[opt_idx], - m_str_options[opt_idx] ? m_str_options[opt_idx] : "NULL"); + { + r.write (" gcc_jit_context_set_str_option (%s,\n" + " %s,\n", + r.get_identifier (contexts[ctxt_idx]), + str_option_reproducer_strings[opt_idx]); + if (m_str_options[opt_idx]) + r.write (" \"%s\");\n", + m_str_options[opt_idx]); + else + r.write (" NULL);\n"); + } r.write (" /* Int options. */\n"); for (int opt_idx = 0; opt_idx < GCC_JIT_NUM_INT_OPTIONS; opt_idx++) r.write (" gcc_jit_context_set_int_option (%s,\n"