Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9qTo-005UPN-4W for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2024 18:14:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s9qTo-002P40-4Z for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2024 18:14:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9qTn-002P3s-Pm for pgsql-general@lists.postgresql.org; Wed, 22 May 2024 18:14:23 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9qTl-000F5a-BQ for pgsql-general@postgresql.org; Wed, 22 May 2024 18:14:23 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 6930130168C4 for ; Wed, 22 May 2024 20:14:21 +0200 (CEST) Received: from s980.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 579052E2C4F5; Wed, 22 May 2024 20:14:21 +0200 (CEST) Received: from s472.loopia.se (unknown [172.22.191.6]) by s980.loopia.se (Postfix) with ESMTP id 553E02201626; Wed, 22 May 2024 20:14:21 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s472.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=yesql.se Received: from s979.loopia.se ([172.22.191.6]) by s472.loopia.se (s472.loopia.se [172.22.190.12]) (amavisd-new, port 10024) with LMTP id YYPEpXg2j8zo; Wed, 22 May 2024 20:14:20 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s979.loopia.se (Postfix) with ESMTPSA id BB2B310BC4A9; Wed, 22 May 2024 20:14:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1716401660; bh=dw7jjkHeXcfGGe2gWK6tepyLMMcfnpEeOA4xCR79pNs=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=eq6UZ7/48p4RmouHja83h4Huckhv6mkyQTYh1XATiQcSVtW2f1OGnbxN0SBaBJnF/ 5oIQlfNFInQu2+CRZkrtIlvunC2ijKZrDmAk9yvBgy+FUnAz4rWtCIR9F/xCJbgzM8 3R7NCGk9jzMGRHmlDf8nsSm+QpIJWWOCnboL932u6H0kVtB7iVI38K32tv6HGsXgbK dJ25Av7KD3pbWSlyy2VBdl2wbdVHS1EBLUPfPvOUGSa+E9IKJczdJFY/u+WMzmdE0L 8qmhG2fH7o6QPJHoJMVZcw8fCp31qSJNZnvva4ga88jEDV+8btOMpcvC5PoQScMf2x xOFpbKDBdzFWA== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: Missed compiler optimization issue in function select_rtable_names_for_explain From: Daniel Gustafsson In-Reply-To: <4162324.1716396813@sss.pgh.pa.us> Date: Wed, 22 May 2024 20:14:10 +0200 Cc: XChy , pgsql-general@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <211F711D-A799-489B-B0BE-10CBEFC51424@yesql.se> References: <05C4ADF5-5E8C-49EC-8E0A-804BB946F1C7@yesql.se> <23848714-3662-428E-8E6D-5986D87491D6@yesql.se> <4162324.1716396813@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3774.500.171.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 22 May 2024, at 18:53, Tom Lane wrote: >=20 > Daniel Gustafsson writes: >> They are known to be zero, but that's not entirely equivalent though = is it? >> NIL is defined as ((List *) NULL) and NULL is typically defined as = ((void *) >> 0), so sizeof(0) would be the size of an int and sizeof(NULL) would = be the size >> of a void pointer. >=20 > There are other places where we assume that a memset-to-zero will > produce null pointers, so I don't think that that objection has > a lot of force. It wasn't really an objection, but (perhaps a badly worded) an attempt = to understand the proposal. > My real answer is that this is our coding style > and we are not going to change it: our normal convention is to > initialize struct fields in declaration order, and that's what > we're doing here. If some particular version of some particular > compiler fails to make an entirely-negligible optimization in > consequence, that is not something we are going to care about. +1 -- Daniel Gustafsson