From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#65491: [PATCH] Improve performance allocating vectors Date: Sat, 16 Sep 2023 18:54:27 +0200 Message-ID: References: <6B2EDD07-AAEB-40E8-B369-F634296BD3D9@gmail.com> <83v8cagkqv.fsf@gnu.org> <83ttrugkj2.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33563"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65491@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 16 18:55:12 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 1qhYZc-0008XG-8F for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Sep 2023 18:55:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhYZO-0004ux-4p; Sat, 16 Sep 2023 12:54:58 -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 1qhYZL-0004uC-EJ for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 12:54:55 -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 1qhYZL-0004ER-6L for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 12:54:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhYZS-0003w2-8u for bug-gnu-emacs@gnu.org; Sat, 16 Sep 2023 12:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Sep 2023 16:55:02 +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.169488328415085 (code B ref 65491); Sat, 16 Sep 2023 16:55:02 +0000 Original-Received: (at 65491) by debbugs.gnu.org; 16 Sep 2023 16:54:44 +0000 Original-Received: from localhost ([127.0.0.1]:48463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhYZA-0003vF-48 for submit@debbugs.gnu.org; Sat, 16 Sep 2023 12:54:44 -0400 Original-Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:47540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhYZ8-0003ux-Jt for 65491@debbugs.gnu.org; Sat, 16 Sep 2023 12:54:43 -0400 Original-Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b962c226ceso50548511fa.3 for <65491@debbugs.gnu.org>; Sat, 16 Sep 2023 09:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694883269; x=1695488069; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=6xzHKryRnaJoqbrxZvVm8ehcgFXqPdF1ZZucTLCMGAc=; b=Me7Bd5gUOdwuO7p9AtrbWV91Hi7y+vbc4YgLVqZe2+igpYw1lIFoRsaM9DSBe23/ib dqZ5dxTzmgSJIiTXoDkoOtpGPi9x3pAEYflDXj1Ckfm6WrwTHW3RlU/yf7q/XtRZ3JAc XutwUz30imUTP3RydY/q347rzRG5MSRVgbEpKCih/iGHThbPb4LN7YBOl8ignQhfmwkc 7uQeO4HlOiNKwDEPpJ4tvDm0dMfFyVx4Tac1QkoYvWDLPIzVk4D+0Tjs2probMhalbs2 DW76E3BFS7ika3x27BZDd6vZKYxnQTBMdbsdmsmY88PKr7uKW82PiVD/BUojzSEd+UPN KqoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694883269; x=1695488069; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6xzHKryRnaJoqbrxZvVm8ehcgFXqPdF1ZZucTLCMGAc=; b=GJrVPZmv53bdXmAUu1uvcUM3Ohb1/jc/8JjmI5dj9v65eWjKT3Jqpsa4NKg9ZNBJ2t 9zrAPrhwQTPlYJjIDMCM/ktMFfQNWLO5G6VagEghr599ZZsNtL9hARzAeovpLu7tUZ9M I+E0KAemolsHZxo2F6xVcloScuzEidpRNj7/O1Kx2Tk1Ol+0Z2GpmLUcXu906Y0J8f3y 64BhZNKMJ0T/HT8Wh9rr2w6duKm6C1sNReSDb2nPI6/NJFP7JSPMv2N4qhOWRZYcZLkY +OkWVSyxsGYGANq/b6YzmJXoxOSnkaakDR/8IVylXuTRaMSkUtyT6mZTNLnPgxT9f6OE osQg== X-Gm-Message-State: AOJu0Yx491CrXlmbLF9JehmI/i2wBGbusI30OD3xuSSf8+HZhEeVm7fV mTR/JcWjwmD3i4Pq5oJyxCw= X-Google-Smtp-Source: AGHT+IHRM4m1dT5IFOATrxHmut8x0VrDUxakqP4EiKpG2ilZ/oGR9iCZbY92D4+O7TXEg2qme+ROrA== X-Received: by 2002:a19:ae07:0:b0:500:9524:f733 with SMTP id f7-20020a19ae07000000b005009524f733mr3780750lfc.20.1694883269118; Sat, 16 Sep 2023 09:54:29 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id l25-20020ac24a99000000b004fc863a0bf6sm1086887lfp.223.2023.09.16.09.54.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Sep 2023 09:54:28 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) 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:270635 Archived-At: 16 sep. 2023 kl. 18.32 skrev Mattias Engdeg=C3=A5rd = : > #define XUNTAG(a, type, ctype) \ > ((ctype *) ((uintptr_t) XLP (a) - (uintptr_t)LISP_WORD_TAG (type))) I pushed this to master after some experiments. Interestingly, Clang didn't warn about the new code at all. On the other = hand, it did probably warn about the old code (with your configuration), = because char *g(char *p) {return p+(1ULL<<62);} results in :8:26: warning: the pointer incremented by 4611686018427387904 = refers past the last possible element for an array in 32-bit address = space containing 8-bit (1-byte) elements (max possible 4294967296 = elements) [-Warray-bounds] char *g(char *p) {return p+(1ULL<<62);} ^ ~~~~~~~~ :8:9: note: array 'p' declared here char *g(char *p) {return p+(1ULL<<62);} ^ but GCC thinks it's fine.