Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQHpA-0001x3-Eo for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Oct 2020 22:22:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kQHp7-0008EC-Uh for pgsql-hackers@arkaria.postgresql.org; Wed, 07 Oct 2020 22:22:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQHp7-0008Dj-O1 for pgsql-hackers@lists.postgresql.org; Wed, 07 Oct 2020 22:22:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQHp1-0006G6-7u for pgsql-hackers@lists.postgresql.org; Wed, 07 Oct 2020 22:22:12 +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 097MM4sx2399357; Wed, 7 Oct 2020 18:22:04 -0400 From: Tom Lane To: Noah Misch cc: David Rowley , PostgreSQL Developers Subject: Re: Recent failures on buildfarm member hornet In-reply-to: <20201007221221.GC1498955@rfd.leadboat.com> References: <1830491.1601944935@sss.pgh.pa.us> <20201007014507.GB1422897@rfd.leadboat.com> <2040113.1602035809@sss.pgh.pa.us> <20201007021941.GD1422897@rfd.leadboat.com> <2233910.1602090798@sss.pgh.pa.us> <20201007212056.GB1498955@rfd.leadboat.com> <2397925.1602107299@sss.pgh.pa.us> <2398543.1602108196@sss.pgh.pa.us> <20201007221221.GC1498955@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Wed, 07 Oct 2020 15:12:21 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2399355.1602109324.1@sss.pgh.pa.us> Date: Wed, 07 Oct 2020 18:22:04 -0400 Message-ID: <2399356.1602109324@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Noah Misch writes: > On Wed, Oct 07, 2020 at 06:03:16PM -0400, Tom Lane wrote: >> After thinking about it a bit more, I'm not even convinced that what >> xlc seems to be doing is illegal per C spec. There are no sequence >> points within >> >> return list_make2(list_concat(directargs, orderedargs), >> makeInteger(ndirectargs)); > There is, however, a sequence point between list_length(directargs) and > list_concat(), and the problem arises because xlc reorders those two. It's > true that makeInteger() could run before or after list_concat(), but that > alone would not have been a problem. Yeah, that is the theory on which the existing code is built, specifically that the list_length fetch must occur before list_concat runs. What I am wondering about is a more aggressive interpretation of "sequence point", namely that the compiler is free to disregard exactly when list_concat's side-effects occur between this statement's sequence points. I'm not sure that the C spec allows that interpretation, but I'm not sure it doesn't, either. regards, tom lane