From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2620 invoked by alias); 16 Jun 2015 18:23:29 -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 2608 invoked by uid 89); 16 Jun 2015 18:23:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.7 on sourceware.org 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-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-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Message-ID: <1434478556.14663.39.camel@surprise> Subject: Re: The output of gcc_jit_context_dump_to_file() is missing parenthesis in expressions involving casts From: David Malcolm To: Dibyendu Majumdar Cc: jit@gcc.gnu.org Date: Thu, 01 Jan 2015 00:00:00 -0000 In-Reply-To: <1434328937.3192.21.camel@surprise> References: <1434328937.3192.21.camel@surprise> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-SW-Source: 2015-q2/txt/msg00081.txt.bz2 On Sun, 2015-06-14 at 20:42 -0400, David Malcolm wrote: > On Sun, 2015-06-14 at 20:11 +0100, Dibyendu Majumdar wrote: > > It seems that in some cases the output is not showing parenthesis > > where it should. > > Yes, this is a bug. > > The dumping fns are somewhat hacky; they have no concept of C precedence > order, and are probably misleading on some expressions. Sorry. > > I've filed it as: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66539 (snip) This should be fixed now for gcc trunk (for GCC 6) as of r224531; gcc_jit_get_debug_string should now add parentheses where needed, mimicking C's precedence order. If after updating to r224531 you still see any expressions where it gets it wrong, please let me know. Dave