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 1l4TfM-0005YZ-4I for pgsql-committers@arkaria.postgresql.org; Tue, 26 Jan 2021 19:06: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 1l4TfL-0008RX-2o for pgsql-committers@arkaria.postgresql.org; Tue, 26 Jan 2021 19:06:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4TfK-0008RP-Ta for pgsql-committers@lists.postgresql.org; Tue, 26 Jan 2021 19:06:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4TfH-0008Fh-Ui for pgsql-committers@lists.postgresql.org; Tue, 26 Jan 2021 19:06:13 +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 10QJ68KP2277318; Tue, 26 Jan 2021 14:06:09 -0500 From: Tom Lane To: Michael Paquier cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures. In-reply-to: <2167663.1611674210@sss.pgh.pa.us> References: <2167663.1611674210@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 26 Jan 2021 10:16:50 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2277316.1611687968.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 26 Jan 2021 14:06:08 -0500 Message-ID: <2277317.1611687968@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Michael Paquier writes: >> On Tue, Jan 26, 2021 at 03:28:39AM +0000, Tom Lane wrote: >>> Improve performance of repeated CALLs within plpgsql procedures. >> lapwing is generating a warning here: > Yeah, I saw that last night. It's weird, because that patch surely > did not change anything that should affect defined-ness of retval. > I plan to fix it by just immediately initializing retval, but I want > to wait a little bit, because I'm curious to see if any other compilers > complain. Did that now. A survey of the buildfarm finds all of these animals warning about retval, in addition to lapwing: curculio | 2021-01-26 11:30:20 | pl_handler.c:228: warning: 'retval'= may be used uninitialized in this function damselfly | 2021-01-26 11:30:28 | pl_handler.c:303:2: warning: 'retva= l' may be used uninitialized in this function [-Wmaybe-uninitialized] locust | 2021-01-26 11:14:42 | pl_handler.c:228: warning: 'retval'= may be used uninitialized in this function mantid | 2021-01-26 11:07:08 | pl_handler.c:303:2: warning: 'retva= l' may be used uninitialized in this function [-Wmaybe-uninitialized] prairiedog | 2021-01-25 13:19:02 | pl_handler.c:227: warning: 'retval'= may be used uninitialized in this function prion | 2021-01-26 10:03:14 | /home/ec2-user/bf/root/HEAD/pgsql.b= uild/../pgsql/src/pl/plpgsql/src/pl_handler.c:303:2: warning: 'retval' may= be used uninitialized in this function [-Wmaybe-uninitialized] rhinoceros | 2021-01-26 09:52:17 | pl_handler.c:303:2: warning: 'retva= l' may be used uninitialized in this function [-Wmaybe-uninitialized] sidewinder | 2021-01-26 11:45:19 | pl_handler.c:303:2: warning: 'retva= l' may be used uninitialized in this function [-Wmaybe-uninitialized] skate | 2021-01-26 09:06:47 | pl_handler.c:303:2: warning: 'retva= l' may be used uninitialized in this function [-Wmaybe-uninitialized] takin | 2021-01-26 08:51:19 | pl_handler.c:303:2: warning: 'retva= l' may be used uninitialized in this function [-Wmaybe-uninitialized] Some of these may predate this commit (the one from prairiedog clearly does). I also noted a few animals complaining about -Wclobber: francolin | 2021-01-14 02:20:10 | /home/andres/build/buildfarm-franco= lin/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:9: warni= ng: variable 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbe= red] piculet | 2021-01-14 04:16:30 | /home/andres/build/buildfarm-picule= t/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:9: warning= : variable 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbere= d] rorqual | 2021-01-14 02:20:10 | /home/andres/build/buildfarm-atomic= s-spinlocks/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:= 9: warning: variable 'retval' might be clobbered by 'longjmp' or 'vfork' [= -Wclobbered] serinus | 2021-01-26 09:44:08 | /home/bf/build/buildfarm-serinus/HE= AD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:16: warning: v= ariable 'procedure_resowner' might be clobbered by 'longjmp' or 'vfork' [-= Wclobbered] serinus | 2021-01-26 09:44:08 | /home/bf/build/buildfarm-serinus/HE= AD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:228:9: warning: va= riable 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] skink | 2021-01-13 19:41:43 | /home/andres/build/buildfarm/HEAD/p= gsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:9: warning: variab= le 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] and made an effort to silence that too. regards, tom lane