From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18346 invoked by alias); 21 Dec 2018 16:37:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18325 invoked by uid 89); 21 Dec 2018 16:37:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=assurance X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Dec 2018 16:37:49 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 286012C1A6E for ; Fri, 21 Dec 2018 10:37:48 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id aNo4gjR3BdnCeaNo4gsvps; Fri, 21 Dec 2018 10:37:48 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VDiGLQHhvrpGr45LiGuvBChMm8V8nKs7AIJkGKCIApA=; b=JEm9dBN8K41UaOcieRyOYxk0lj fT+rGsj7Zj/UNJhmAQgpDXOiG45VH1C6W49hkG0l8IwM4tUBgngq8vjL8n+yRbXu6DAzwVkWWZgC/ NVfMB0e4u5GRNnrWOvlAsupeI; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:57848 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gaNo3-002tmn-Pl; Fri, 21 Dec 2018 10:37:47 -0600 From: Tom Tromey To: Andrew Burgess Cc: gdb-patches@sourceware.org, Tom Tromey , Simon Marchi , jimw@sifive.com, jhb@FreeBSD.org, palmer@sifive.com Subject: Re: [PATCHv2 2/4] gdb: Resolve 49 reduce/reduce conflicts in c-exp.y References: <6ea141fbd952fef1a7228c08fb4eeb98f1fa5370.1545172667.git.andrew.burgess@embecosm.com> Date: Fri, 21 Dec 2018 16:37:00 -0000 In-Reply-To: <6ea141fbd952fef1a7228c08fb4eeb98f1fa5370.1545172667.git.andrew.burgess@embecosm.com> (Andrew Burgess's message of "Tue, 18 Dec 2018 22:40:11 +0000") Message-ID: <87muoysun9.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-12/txt/msg00248.txt.bz2 >>>>> "Andrew" == Andrew Burgess writes: Andrew> This commit splits the ptr_operator rule in c-exp.y in two, resolving Andrew> 49 reduce/reduce conflicts in the process. There should be no Andrew> user visible change after this commit. Andrew> There are still 42 shift/reduce and 4 reduce/reduce conflicts Andrew> remaining in c-exp.y (using GNU bison 3.0.4). Andrew> gdb/ChangeLog: Andrew> * c-exp.y (base_ptr_operator): New rule, with non-recursive Andrew> content taken from... Andrew> (ptr_operator): ...here, leaving just the recursion here. Andrew> -ptr_operator: Andrew> - ptr_operator '*' Andrew> +base_ptr_operator Andrew> + : '*' Andrew> { insert_type (tp_pointer); } Andrew> - const_or_volatile_or_space_identifier Andrew> - | '*' Andrew> - { insert_type (tp_pointer); } Andrew> - const_or_volatile_or_space_identifier Andrew> + const_or_volatile_or_space_identifier Andrew> | '&' Andrew> { insert_type (tp_reference); } Andrew> - | '&' ptr_operator Andrew> - { insert_type (tp_reference); } Andrew> | ANDAND Andrew> { insert_type (tp_rvalue_reference); } Andrew> - | ANDAND ptr_operator Andrew> - { insert_type (tp_rvalue_reference); } I don't really understand the previous code here -- in particular why the '*' case puts ptr_operator first, while the '&' and '&&' cases put it second. Does this patch change the order of calls to insert_type? I find it hard to reason about what is going on here, so some assurance that it is all ok would be good. According to my --coverage build, the "'&' ptr_operator" and "ANDAND ptr_operator" rules are not exercised by the test suite. So, if there is a change, it wouldn't necessarily be noticed :( Tom