Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Improve performance of repeated CALLs within plpgsql procedures.
Date: 2021-01-26 19:06:08
Message-ID: 2277317.1611687968@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

I wrote:
> Michael Paquier <michael(at)paquier(dot)xyz> 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: 'retval' 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: 'retval' 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.build/../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: 'retval' may be used uninitialized in this function [-Wmaybe-uninitialized]
sidewinder | 2021-01-26 11:45:19 | pl_handler.c:303:2: warning: 'retval' may be used uninitialized in this function [-Wmaybe-uninitialized]
skate | 2021-01-26 09:06:47 | pl_handler.c:303:2: warning: 'retval' may be used uninitialized in this function [-Wmaybe-uninitialized]
takin | 2021-01-26 08:51:19 | pl_handler.c:303:2: warning: 'retval' 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-francolin/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:9: warning: variable 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
piculet | 2021-01-14 04:16:30 | /home/andres/build/buildfarm-piculet/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:9: warning: variable 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
rorqual | 2021-01-14 02:20:10 | /home/andres/build/buildfarm-atomics-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/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:16: warning: variable 'procedure_resowner' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
serinus | 2021-01-26 09:44:08 | /home/bf/build/buildfarm-serinus/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:228:9: warning: variable 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
skink | 2021-01-13 19:41:43 | /home/andres/build/buildfarm/HEAD/pgsql.build/../pgsql/src/pl/plpgsql/src/pl_handler.c:227:9: warning: variable 'retval' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]

and made an effort to silence that too.

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2021-01-26 19:43:13 pgsql: Report the true database name on connection errors
Previous Message Tom Lane 2021-01-26 18:58:24 pgsql: Suppress compiler warnings from commit ee895a655.