From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 42176 invoked by alias); 25 Nov 2016 16:37:11 -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 42162 invoked by uid 89); 25 Nov 2016 16:37:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=3717, distinction X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Nov 2016 16:37:09 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAPGYRKI018612 for ; Fri, 25 Nov 2016 11:37:07 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 26xn9b9pc3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 25 Nov 2016 11:37:07 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 25 Nov 2016 16:37:04 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 25 Nov 2016 16:37:03 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D0E862190023; Fri, 25 Nov 2016 16:36:14 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uAPGb2ie18743462; Fri, 25 Nov 2016 16:37:02 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DFB584C044; Fri, 25 Nov 2016 15:35:16 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AD1434C046; Fri, 25 Nov 2016 15:35:16 +0000 (GMT) Received: from oc5510024614.ibm.com (unknown [9.145.29.2]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 25 Nov 2016 15:35:16 +0000 (GMT) Received: by oc5510024614.ibm.com (Postfix, from userid 500) id 56BBB1AA23; Fri, 25 Nov 2016 17:37:01 +0100 (CET) Date: Fri, 25 Nov 2016 16:37:00 -0000 From: Dominik Vogt To: David Malcolm Cc: Jakub Jelinek , Bernd Schmidt , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] (v2) Add a "compact" mode to print_rtx_function Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: vogt@linux.vnet.ibm.com, David Malcolm , Jakub Jelinek , Bernd Schmidt , gcc-patches@gcc.gnu.org References: <43d4ec20-5f84-2533-22e4-e16c779f6162@redhat.com> <1476304646-39819-1-git-send-email-dmalcolm@redhat.com> <20161122131836.GA7025@linux.vnet.ibm.com> <48811c08-6412-2e8b-2763-b163c358afe3@redhat.com> <20161122133750.GR3541@tucnak.redhat.com> <20161122144501.GU3541@tucnak.redhat.com> <1479829122.7673.83.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479829122.7673.83.camel@redhat.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112516-0012-0000-0000-00000496DA0F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112516-0013-0000-0000-0000165AF15E Message-Id: <20161125163700.GA6388@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-25_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611250284 X-SW-Source: 2016-11/txt/msg02645.txt.bz2 On Tue, Nov 22, 2016 at 10:38:42AM -0500, David Malcolm wrote: > On Tue, 2016-11-22 at 15:45 +0100, Jakub Jelinek wrote: > > On Tue, Nov 22, 2016 at 03:38:04PM +0100, Bernd Schmidt wrote: > > > On 11/22/2016 02:37 PM, Jakub Jelinek wrote: > > > > Can't it be done only if xloc.file contains any fancy characters? > > > > > > Sure, but why? Strings generally get emitted with quotes around > > > them, I > > > don't see a good reason for filenames to be different, especially > > > if it > > > makes the output easier to parse. > > > > Because printing common filenames matches what we emit in > > diagnostics, > > what e.g. sanitizers emit at runtime diagnostics, what we emit as > > locations > > in gimple dumps etc. > > It sounds like a distinction between human-readable vs machine > -readable. > > How about something like the following, which only adds the quotes if > outputting the RTL FE's input format? > > Does this fix the failing tests? Yep. > --- a/gcc/print-rtl.c > +++ b/gcc/print-rtl.c > @@ -371,7 +371,10 @@ rtx_writer::print_rtx_operand_code_i (const_rtx in_rtx, int idx) > if (INSN_HAS_LOCATION (in_insn)) > { > expanded_location xloc = insn_location (in_insn); > - fprintf (m_outfile, " \"%s\":%i", xloc.file, xloc.line); > + if (m_compact) > + fprintf (m_outfile, " \"%s\":%i", xloc.file, xloc.line); > + else > + fprintf (m_outfile, " %s:%i", xloc.file, xloc.line); Looks sensible to me. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany