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 1s9sDW-005hF3-IM for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2024 20:05:43 +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 1s9sDW-003Hb5-2b for pgsql-general@arkaria.postgresql.org; Wed, 22 May 2024 20:05:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9sDV-003Haw-Nd for pgsql-general@lists.postgresql.org; Wed, 22 May 2024 20:05:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9sDT-001VHA-7v for pgsql-general@postgresql.org; Wed, 22 May 2024 20:05:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 44MK5Wl4006807; Wed, 22 May 2024 16:05:32 -0400 From: Tom Lane To: Alvaro Herrera cc: XChy , pgsql-general@postgresql.org Subject: Re: Missed compiler optimization issue in function select_rtable_names_for_explain In-reply-to: <202405221100.fy66dsew2f52@alvherre.pgsql> References: <202405221100.fy66dsew2f52@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Wed, 22 May 2024 13:00:12 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6805.1716408332.1@sss.pgh.pa.us> Date: Wed, 22 May 2024 16:05:32 -0400 Message-ID: <6806.1716408332@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > I think if we want to improve how this code is seen by the compiler by > modifying it, we should just remove the NULL/NIL assignments. It's a > pretty arbitrary (and rather small) subset of fields being initialized, > fields which very obviously have been zeroed by memset already, so I > don't see any value in the explicit assignments. I have to concede that it's unclear why we're filling just these fields explicitly and not any others. We're at least consistent: all the callers of select_rtable_names do it the same way. regards, tom lane