From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#31350: 27.0; `pcase' message: "Redundant pcase pattern" Date: Wed, 2 May 2018 17:48:35 -0700 (PDT) Message-ID: <86d352f4-5fa7-4bee-b72c-17e58aace43f@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1525308428 16599 195.159.176.226 (3 May 2018 00:47:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 3 May 2018 00:47:08 +0000 (UTC) To: 31350@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 03 02:47:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fE2Oj-0004Bx-CD for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 May 2018 02:47:01 +0200 Original-Received: from localhost ([::1]:53210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE2Qq-0000rQ-Hf for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 May 2018 20:49:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE2Qk-0000qu-9p for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 20:49:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE2Qg-0000wg-As for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 20:49:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fE2Qg-0000wY-6T for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 20:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fE2Qf-0001zw-Tc for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 20:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 May 2018 00:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31350 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15253085347664 (code B ref -1); Thu, 03 May 2018 00:49:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 May 2018 00:48:54 +0000 Original-Received: from localhost ([127.0.0.1]:47487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fE2QX-0001zX-Kz for submit@debbugs.gnu.org; Wed, 02 May 2018 20:48:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fE2QV-0001zL-Fu for submit@debbugs.gnu.org; Wed, 02 May 2018 20:48:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE2QP-0000r8-Eh for submit@debbugs.gnu.org; Wed, 02 May 2018 20:48:46 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41160) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fE2QP-0000r0-AN for submit@debbugs.gnu.org; Wed, 02 May 2018 20:48:45 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE2QO-0000qd-5E for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 20:48:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE2QK-0000pI-7R for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 20:48:44 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:58662) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fE2QJ-0000ok-UM for bug-gnu-emacs@gnu.org; Wed, 02 May 2018 20:48:40 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w430k5Kq168962 for ; Thu, 3 May 2018 00:48:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=PPwTho5s1rvH92BDsS/gfnyw9+nllrtAFpMFnLJFnCw=; b=F7kp83ydnQF0QlN9m1YDl8UlV9XggO1BLbZbtQCjXPHIPMQsb0vVExTFS/PqYBGmUdPb G56nvFoQmxwg/faIpc+VAgTWP0D1Y6dQv4ZRR+1dweZMPpeZdGkHvn1j0HnmlQcwFn9O t+JaNf+dToSx4qgBDQZk3ApFQDQ/NI2FT+ryQ9BJFTTuBk6dt0vaF7DCqDLgQ5JWChSj y/x3MB1hexhKVJjjw5kfA1UG9lCpaT9hAn9L3AeqB18lCskU/qJKRH175rV5m3cOhaAe gtbujLcspArGmLd2JuHbS/ps/PT7PrakgLBVijjgLq/UImYBxuX+Azrfi0jpBAQS8R2x LA== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2hmgxfyfgd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 03 May 2018 00:48:38 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w430mbFU005025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 3 May 2018 00:48:37 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w430mbmu020273 for ; Thu, 3 May 2018 00:48:37 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4678.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8881 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=958 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805030005 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:145952 Archived-At: I mistakenly had not removed an old version of a pcase clause that I changed, so one of the two was redundant. Compiling showed the redundancy message in *Messages*. Compiling also showed a message in *Compile Log* saying that a lexical variable, which occurred only in the second of the clauses with redundant patterns, was unused. But the interpreted code worked as I wanted. Apparently it was the first of the two clauses (not the second, which had the "unused" lexical variable) that was ignored when interpreting. That lexical variable was used when interpreting. Can the messaging be improved, to tell you what the effect will be of the redundant clauses when using the byte-compiled code, versus what it might be for the interpreted code? Can the compiler tell a user, for example, which of a set of clauses with redundancy will (or will not) be used? The current messaging seems a bit confusing/incomplete. It pointed to the second of the two clauses, which was OK, and which had the "unused" lexical variable (which was in fact used, at least when interpreting), saying that it was redundant. Can the messaging at least tell you (1) all of a set of clauses that are mutually redundant and (2) which one of them will actually be used by the compiled code, the others presumably having been pruned? These are the two clauses in question: (`,a `(not,a)) ((and a (guard (not recursivep))) `(not ,a)) Variable RECURSIVEP is an argument passed to the function that invokes the `pcase'. The second clause is the good one. It is the one that was flagged as redundant and having an unused lexical variable. Is it the clause that gets pruned when compiling? When interpreting it seems like the first of the two clauses is not used. In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32) of 2018-03-21 Repository revision: e70d0c9e66d7a8609450b2889869d16aeb0363b5 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install -C 'CFLAGS=3D-O2 -static -g3''