From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65491: [PATCH] Improve performance allocating vectors Date: Sun, 17 Sep 2023 22:27:43 -0400 Message-ID: References: <6B2EDD07-AAEB-40E8-B369-F634296BD3D9@gmail.com> <83v8cagkqv.fsf@gnu.org> <83ttrugkj2.fsf@gnu.org> <83sf7egitx.fsf@gnu.org> <871qexzelk.fsf@yahoo.com> <87jzsoxlya.fsf@yahoo.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12357"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65491@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Eli Zaretskii To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 18 04:29:10 2023 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 1qi40a-0002vj-K7 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Sep 2023 04:29:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qi40O-0001Uy-Mx; Sun, 17 Sep 2023 22:28:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qi40M-0001TD-Ic for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 22:28:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qi40M-0000uD-AH for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 22:28:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qi40T-00054p-PI for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 22:29:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Sep 2023 02:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65491-submit@debbugs.gnu.org id=B65491.169500408219419 (code B ref 65491); Mon, 18 Sep 2023 02:29:01 +0000 Original-Received: (at 65491) by debbugs.gnu.org; 18 Sep 2023 02:28:02 +0000 Original-Received: from localhost ([127.0.0.1]:51719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi3zW-000537-6j for submit@debbugs.gnu.org; Sun, 17 Sep 2023 22:28:02 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31227) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qi3zT-00052Z-5H for 65491@debbugs.gnu.org; Sun, 17 Sep 2023 22:28:00 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BD498442860; Sun, 17 Sep 2023 22:27:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1695004064; bh=mbmzy8mI8PqhKR8KYUrBSll0IUUyTvdWXHgeOlTak7s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=jL9urIaZgm1Em84Qfiyt9eDen9m16ch22b0cgA6w17JQDEHVdJTxzaAqNdnTr8wl2 T1YD9/QzJuc6EUaq84/+9XU+YziwjCISvKh3ohEvBpX72NKVbAtpp9UGq+0KmyFedB DMpw3fcix2lEndbQBNqZsvHGrfo9CNEHzkQySoyBkX72YSspQkcYk5TSPJx9NqepaD /aS/4SCufRTYv8zmCsIU6U788Ap9GiX7KGwM8Rg8Ca0oCcn3eORiQSC2G1w6b7h9Vg 32G0qOpGu3CTbV/LqTsVXId+CDz/fGn/y27YVSrsI1xqpAnCtGL3KIc1JB+EVGMTaO 9HNJ0qGz5jIrw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7E93144284B; Sun, 17 Sep 2023 22:27:44 -0400 (EDT) Original-Received: from pastel (unknown [45.72.220.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 51F821202C3; Sun, 17 Sep 2023 22:27:44 -0400 (EDT) In-Reply-To: <87jzsoxlya.fsf@yahoo.com> (Po Lu's message of "Mon, 18 Sep 2023 10:19:09 +0800") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270735 Archived-At: >> Even converting them back to their original pointer (which is what we do >> with tag/untag pairs) is documented to be well-defined if you compile >> using GCC. > Only if the consequent pointer designates the same object as the initial > pointer (of which I see no scrutable definition within GCC's > documentation.) IIUC the "if" here is talking about the fact that if the object is deallocated between the two casts, then you're on your own, of course. >> In contrast the pointer arithmetic on NULL pointers appears to be >> something which compilers have started to (ab)use as an assumption for >> their optimizations. Hence the need to update our code. > Hmm? Where in this thread was that fact established? IIUC Mattias bumped into this after he made a few "innocent looking" changes to the vector allocation code. Stefan