From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jimmy Yuen Ho Wong Newsgroups: gmane.emacs.devel Subject: Re: How does nativecomp compile circular lists? Date: Thu, 29 Jul 2021 11:43:08 +0100 Message-ID: References: <6247f78b-282f-27e7-e0cf-6bc3b1cdee26@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B7DB4B69914D94203EA0F600" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15861"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Cc: Emacs-Devel devel To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 29 12:43:50 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m93W1-0003xs-EW for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Jul 2021 12:43:49 +0200 Original-Received: from localhost ([::1]:38836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m93Vz-0000fo-L3 for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Jul 2021 06:43:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m93VS-0008PC-B8 for emacs-devel@gnu.org; Thu, 29 Jul 2021 06:43:14 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:42826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m93VQ-0002YC-Gt for emacs-devel@gnu.org; Thu, 29 Jul 2021 06:43:14 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id e25-20020a05600c4b99b0290253418ba0fbso3717085wmp.1 for ; Thu, 29 Jul 2021 03:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=YVc+qJ78tbNGcpOxTg9tECDJhzlcnLToBXPkFdixp2Q=; b=ofUHhhnzD7nktlgQbkHmxIx1adPjDI6UFsBfWPadQKA4kwBWO88CJI2bVgJ+VSfIiv 4lro4z3Ch0L7aGDWuHAmdIHcHS5ihRniQZnkl4JH/M9Y3U2uHypUOYSsha9svUjgddHz o4vkH5q9W7eSBz/1/cpQzKxkjjqIlzG0ACmlnIHNN8Aj5DpzkRJN2nswGqQU0wVS6J0y snpMwGXJtzGHxOf9+rhpz6/Ti/RjrNfKi1P0U8u2uhmmMR4RfaHb2JF+BNokjte/anGu C99RN3B891x7FvMPgoTNZ/RC/aUh+T6ZA2xJhhTgJbgL691rSZ6uoHP2qJNHLH02dZHj +zug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=YVc+qJ78tbNGcpOxTg9tECDJhzlcnLToBXPkFdixp2Q=; b=h6u5XbNQaEZdhDFilBjpjdiEIBGVwYv32JdxckyIjVFeAeqOUFjzTCzCsKFtxeQTbI CB94WKWM39kqlZ+nIrqQCQ23LircxhpLFGMWoO70nzYJ+prBm5fqUOvY5hAjkZfwyO7a fVvFyjtFiKzkZ3wG/c/nDffh3eq24OxVIE5KRvHhmPwjDOkWDul2uh6S7uxex5qex0N6 I6iwxP0xhgyOhkZQEUJgiFnSkO9K6kqjsirniyf6pCD1NyaFkxRz/46eUfCapB0gA+yh Bb+D0b7SXOVGAoiv3iAVRojjP8BNe6HO6wK0qGVdREZNvbJYXIm7UT1isz05n9VgD+L6 YqAQ== X-Gm-Message-State: AOAM530pvs93PBlYE74GNEhFpG1cl1T+lpLDFWg+cL1ZDX0PMv+6YJWJ sBZDBBzhjabUCllrRucGZ2quyCC+4rE= X-Google-Smtp-Source: ABdhPJyBk3f1rz22MTPvkLt4jYVNl6femb0wKzy31Whd3I7O1m32GSNFtxcvwLiHVHT4V5DlqK7U/w== X-Received: by 2002:a05:600c:304a:: with SMTP id n10mr10834042wmh.79.1627555390422; Thu, 29 Jul 2021 03:43:10 -0700 (PDT) Original-Received: from MobileCat.local ([137.220.76.130]) by smtp.gmail.com with ESMTPSA id i5sm2925579wrw.13.2021.07.29.03.43.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Jul 2021 03:43:09 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=wyuenho@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.277, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271788 Archived-At: This is a multi-part message in MIME format. --------------B7DB4B69914D94203EA0F600 Content-Type: multipart/alternative; boundary="------------8792BC9819DCF19EE0E62010" --------------8792BC9819DCF19EE0E62010 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 28/07/2021 4:11 PM, Andrea Corallo wrote: > Jimmy Yuen Ho Wong writes: > > [...] > >> [re-adding the list] >> >> Hi Jimmy, >> >> thanks for the patch. >> >> So I guess is clear this is unrelated to circular lists and probably >> disassemble is just broken for every native compiled function in this >> configuration. >> >> We might have other architecture+OS where function labels start with '_' >> but so far the patch LGTM, I just suggest a small nit. >> >> > diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el >> > index 6ac76f1c19..d0e3bf7bf4 100644 >> > --- a/lisp/emacs-lisp/disass.el >> > +++ b/lisp/emacs-lisp/disass.el >> > @@ -95,6 +95,7 @@ disassemble-internal >> > (re-search-forward (concat "^.*" >> > (regexp-quote >> > (concat "<" >> > + (if (eq system-type 'darwin) "_") >> ^^^ >> I'd use `when' here. >> > (comp-c-func-name >> > (subr-name obj) "F" t) >> > ">:")))) >> >> Do you aready have copyright assignment? >> >> Best Regards >> >> Andrea >> >> I do have an existing copyright assignment. No objection to using a when there, would you like me to submit a new patch >> or you are fine with editing it yourself? > If you could provide a complete patch (including Changelog entry) that > would be appreciated thanks (please see the CONTRIBUTE file if in > doubt). I'll be happy to install your patch if you don't have write > access. > >> As to whether this is related to circular lists, I'm not so sure yet. > This is certanly not related to circular lists, this is just about how > lables are named on this specific triplet. > >> There's definitely something in native compilation >> that compiles code that behaves differently when circular lists are involved, I just haven't found out what interaction >> with circular lists will result in compilation failure or optimizing the result away. Any clues for what I should try is >> much appreciated. > If you have some code/package that behaves differently byte vs native > compiled you should be able to identify the function causing the > difference when executed. Once that is done we could start > investigating. > > Regards > > Andrea Here's a new patch. Thanks in advance for installing it. --------------8792BC9819DCF19EE0E62010 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
On 28/07/2021 4:11 PM, Andrea Corallo wrote:
Jimmy Yuen Ho Wong <wyuenho@gmail.com> writes:

[...]

 [re-adding the list]

 Hi Jimmy,

 thanks for the patch.

 So I guess is clear this is unrelated to circular lists and probably
 disassemble is just broken for every native compiled function in this
 configuration.

 We might have other architecture+OS where function labels start with '_'
 but so far the patch LGTM, I just suggest a small nit.

 > diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el
 > index 6ac76f1c19..d0e3bf7bf4 100644
 > --- a/lisp/emacs-lisp/disass.el
 > +++ b/lisp/emacs-lisp/disass.el
 > @@ -95,6 +95,7 @@ disassemble-internal
 >                (re-search-forward (concat "^.*"
 >                                           (regexp-quote
 >                                            (concat "<"
 > +                                                  (if (eq system-type 'darwin) "_")
                                                      ^^^
                                                      I'd use `when' here.
 >                                                    (comp-c-func-name
 >                                                     (subr-name obj) "F" t)
 >                                                    ">:"))))

 Do you aready have copyright assignment?

 Best Regards

   Andrea

I do have an existing copyright assignment. No objection to using a when there, would you like me to submit a new patch
or you are fine with editing it yourself?
If you could provide a complete patch (including Changelog entry) that
would be appreciated thanks (please see the CONTRIBUTE file if in
doubt).  I'll be happy to install your patch if you don't have write
access.

As to whether this is related to circular lists, I'm not so sure yet.
This is certanly not related to circular lists, this is just about how
lables are named on this specific triplet.

There's definitely something in native compilation
that compiles code that behaves differently when circular lists are involved, I just haven't found out what interaction
with circular lists will result in compilation failure or optimizing the result away. Any clues for what I should try is
much appreciated.
If you have some code/package that behaves differently byte vs native
compiled you should be able to identify the function causing the
difference when executed.  Once that is done we could start
investigating.

Regards

  Andrea

Here's a new patch. Thanks in advance for installing it.

--------------8792BC9819DCF19EE0E62010-- --------------B7DB4B69914D94203EA0F600 Content-Type: text/plain; charset=UTF-8; x-mac-type="0"; x-mac-creator="0"; name="disass.el.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="disass.el.patch" ZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC9kaXNhc3MuZWwgYi9saXNwL2VtYWNzLWxp c3AvZGlzYXNzLmVsCmluZGV4IDZhYzc2ZjFjMTkuLmJiMmU0ODQ5YWQgMTAwNjQ0Ci0tLSBh L2xpc3AvZW1hY3MtbGlzcC9kaXNhc3MuZWwKKysrIGIvbGlzcC9lbWFjcy1saXNwL2Rpc2Fz cy5lbApAQCAtOTUsNiArOTUsNyBAQCBkaXNhc3NlbWJsZS1pbnRlcm5hbAogICAgICAgICAg ICAgICAocmUtc2VhcmNoLWZvcndhcmQgKGNvbmNhdCAiXi4qIgogICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAocmVnZXhwLXF1b3RlCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uY2F0ICI8IgorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAod2hlbiAoZXEgc3lzdGVt LXR5cGUgJ2RhcndpbikgIl8iKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoY29tcC1jLWZ1bmMtbmFtZQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHN1YnItbmFtZSBvYmopICJGIiB0 KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAi PjoiKSkpKQo= --------------B7DB4B69914D94203EA0F600--