From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#46847: 28.0.50; [native-comp] assume pseudo-insns should be verified Date: Fri, 05 Mar 2021 19:36:57 +0000 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36929"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46847@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 05 20:37:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lIGG6-0009Ts-37 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 20:37:10 +0100 Original-Received: from localhost ([::1]:41074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIGG5-0003XN-5Z for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 14:37:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIGFy-0003X2-HZ for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 14:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIGFy-00083m-AP for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 14:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lIGFy-0002JD-7Y for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 14:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Mar 2021 19:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46847 X-GNU-PR-Package: emacs Original-Received: via spool by 46847-submit@debbugs.gnu.org id=B46847.16149730208867 (code B ref 46847); Fri, 05 Mar 2021 19:37:02 +0000 Original-Received: (at 46847) by debbugs.gnu.org; 5 Mar 2021 19:37:00 +0000 Original-Received: from localhost ([127.0.0.1]:35486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIGFv-0002Ix-RH for submit@debbugs.gnu.org; Fri, 05 Mar 2021 14:37:00 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:61587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIGFu-0002Ip-Py for 46847@debbugs.gnu.org; Fri, 05 Mar 2021 14:36:59 -0500 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 125JavAm020786 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 5 Mar 2021 19:36:58 GMT In-Reply-To: (Pip Cet's message of "Fri, 5 Mar 2021 16:09:20 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201575 Archived-At: Pip Cet writes: > On Mon, Mar 1, 2021 at 1:08 PM Pip Cet wrote: >> I would like to add an optional compiler pass which asserts that the >> conditions are actually true at runtime. This is a basic safeguard >> that any assume() mechanism should have, and it's perfectly equivalent >> to the way eassume() becomes eassert() in debug builds of Emacs. > > I've proceeded to change things so I can assert assumes, and here's an > incomplete list of the bugs I've found so far: > > Function types: > 1. append has type (function (&rest t) t), not (function (&rest list) list) > 2. aref has type (function (t fixnum) t), not (function (array fixnum) t) > 3. bool-vector-count-consecutive has type (function (bool-vector > boolean integer) fixnum), not (function (bool-vector bool-vector > integer) fixnum)) > 4. at least some of the frame-* functions accept nil parameters > 5. intern-soft has type (function ((or string symbol) &optional > vector) symbol), not (function (string &optional vector) symbol) > 6. length has type (function (t) integer), not (function (sequence) integer) > 7. at least some of the minibuffer functions can return nil as well as a window. > 8. nthcdr has type (function (integer t) t), not (function (integer list) list) > 9. radians-to-degrees is a macro and probably shouldn't have a function type > 10. string has type (function (&rest fixnum) string), not (function > (&rest fixnum) strng) > 11. user-full-name has type (function (&optional integer) (or string > null)), not (function (&optional integer) string) > Predicate types: > 1. functionp isn't equivalent to (or function symbol) Thanks, patches are welcome. Andrea