From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: raman Newsgroups: gmane.emacs.devel Subject: Re: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.] Date: Thu, 23 Feb 2017 08:15:40 -0800 Message-ID: References: <1b07c68a-873e-83c8-246d-423bc83a3881@gmail.com> <83y3xg4ldw.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1487866608 24268 195.159.176.226 (23 Feb 2017 16:16:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Feb 2017 16:16:48 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, Eli Zaretskii , Vibhav Pant , Emacs developers To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 23 17:16:40 2017 Return-path: Envelope-to: ged-emacs-devel@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 1cgw4M-0005U6-R8 for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2017 17:16:38 +0100 Original-Received: from localhost ([::1]:59569 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgw4S-0005p2-EX for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2017 11:16:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgw3a-0005mH-DG for emacs-devel@gnu.org; Thu, 23 Feb 2017 11:15:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgw3W-0005G6-Fg for emacs-devel@gnu.org; Thu, 23 Feb 2017 11:15:50 -0500 Original-Received: from mail-pg0-x232.google.com ([2607:f8b0:400e:c05::232]:33181) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cgw3W-0005FI-7k for emacs-devel@gnu.org; Thu, 23 Feb 2017 11:15:46 -0500 Original-Received: by mail-pg0-x232.google.com with SMTP id z128so16788072pgb.0 for ; Thu, 23 Feb 2017 08:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=3ggCO5A6TjKe6jli8Zh1tyY4TRFny/lZT/tdLuge+5g=; b=Qpp7MQW9COC2ZS99jfEQjAtQdNhWddzyjsIykz+v0JV3iAtwBt4j93/kQOsujdJwo7 DfIIqhEJnGVXfTGt5KT7qUGbLvULQWoVZSuiXa68Dwg2lDOKhCSPV3p1FDIEKHVCFppQ kQpzowWxW3AwxjnnHH9AG29jnYxG5mWcosDS7Mw7oTxpF60R5EYUP+Je0fFxSAs4dVnc aLOvoUqmO2dTB9E5NW87SomAx+KHLW5dlliBBinlw5LMUl3Rz/AZGJ/sDt89qWOqsIsJ SH4oe/Era1z+vTfDuXcpsIWUR0VjKcFjCInz8zPnsCQvxPWwtcWx5SfJu2Eh2V1Wyh50 Ltpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=3ggCO5A6TjKe6jli8Zh1tyY4TRFny/lZT/tdLuge+5g=; b=VakXt2q1BRtERbYRKvo0FISiP6t1P1TaxMzgHVUa2KPfjXWcQx0TC6zPQ93r9CimfT OdPi754HwGXoI9V1gedGRJzAlQZLKLY6xeJF96LekztHvXmgKpWJXg5xbmLp/+gU19JA WWrdCKDipPEGVP2KY2Xl4FKWV9dRSypLIBRsICcJ7RzFbPXfZvdu0c24D2J0FtLYjgFi ZvQb3bBfSRW65d6aSwWkAQ1dZP4jOJjb4cJUjuUVf/IuJRV7MUsJ4Cv7ZzHf6cORrfvl 4EMQU96daYQP0WLMCij5o5UY5Tx5XJk452qLhFBHbywHLldEZRT4P5pFA/fekLQ4Ib8Y 9+PA== X-Gm-Message-State: AMke39nnHWaJlj9J5+6wVmyQ5sfG9NWdYiIHB6nwXe8zh0gYVvkDdCtNQ0hqEzYkKwkCxq84 X-Received: by 10.99.129.200 with SMTP id t191mr49020453pgd.129.1487866543512; Thu, 23 Feb 2017 08:15:43 -0800 (PST) Original-Received: from raman-glaptop2 ([207.198.106.187]) by smtp.gmail.com with ESMTPSA id c72sm10666567pfj.77.2017.02.23.08.15.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 23 Feb 2017 08:15:42 -0800 (PST) In-Reply-To: (Tino Calancha's message of "Thu, 23 Feb 2017 13:35:54 +0900 (JST)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212548 Archived-At: Tino Calancha writes: Likely related, I'm also noticing that code that compiles and run correctly against 25.1 and that used to compile and run error-free on Master just started breaking, I'm still working on creating a small repro case. But what I'm noticing: With code compiled with lexical scoping, defsubst forms appear to behave differently when compiled vs evaled --- eval: no error, compile and load == error. > Sorry if this is obvious, then just ignore. > > I have a custom lib using `pcase' somewhere. That lib is > compatible with Emacs25. > Usually i compile this lib against the master branch. Then, i load > that very same resulting .elc in Emacs-25 and runs same as in Emacs-26. > (Maybe this is just wrong and i must keep separated .elc) > > After the new bytecode those parts of the lib using pcase fail. > For instance, put the following in a file: > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > (defun test-case () > (let ((val "foo")) > (pcase val > ("foo" "foo") > ("bar" "bar") > (_ (error "Neither 'foo' nor 'bar'"))))) > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > I) Compile under master branch. > II) Load the resultant .elc with Emacs-25 > II) M-: (test-case) > ;; Signal error: Invalid byte opcode: op=183, ptr=4 > > So, in conclusion: > From now on, we need to keep two separated .elc in such custom libs, > right? > --