Re: gcc 13 warnings
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, Melanie Plageman <melanieplageman@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-03-16T18:11:00Z
Lists: pgsql-hackers
Hi, On 2023-03-16 13:54:29 -0400, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > > On 2023-03-16 12:10:27 -0400, Tom Lane wrote: > >> It wouldn't be entirely surprising if meson is selecting some -W > >> switches that the configure script doesn't ... but I don't know > >> where to check or change that. > > > I think it's just that meson defaults to -O3 (fwiw, I see substantial gains of > > that over -O2). I see such warnings with autoconf as well if I make it use > > -O3. > > Oh, interesting. Should we try to standardize the two build systems > on the same -O level, and if so which one? I'm on the fence on this one (and posed it as a question before). O3 does result in higher performance for me, but it also does take longer to build, and increases the numbers of warnings. So I just elected to leave it at the default for meson. > To my mind, you should ideally get the identical built bits out of > either system, so defaulting to a different -O level seems bad. I doubt that is attainable, unfortunately. My experience is that even trivial changes can lead to substantial changes in output. Even just being in a different directory (the root build directory for meson vs the subdirectory in make builds) apparently sometimes leads to different compiler output. > I'm not sure if we're prepared to go to -O3 by default though, > especially for some of the older buildfarm critters where that > might be buggy. (I'd imagine you take a hit in gdb-ability too.) My experience is that debuggability is already bad enough at O2 that the difference to O3 is pretty marginal. But it certainly depends a bit on the compiler version and what level of debug information one enables. Greetings, Andres Freund
Commits
-
Use pg_assume() to avoid compiler warning below exec_set_found()
- 48a23f6eae71 19 (unreleased) landed
-
Add pg_assume(expr) macro
- d65eb5b1b84e 19 (unreleased) landed
-
meson: Change default buildtype to debugoptimized
- 5aae36dc9c68 16.0 landed