On Fri, Mar 17, 2023 at 1:11 AM Andres Freund <
andres@anarazel.de> wrote:
> On 2023-03-16 13:54:29 -0400, Tom Lane wrote:
> So I just elected to leave it at the default for meson.
In my build scripts I've been setting it to -O2, because that seemed the obvious thing to do, and assumed some later commit would get rid of the need to do it manually. (if it was discussed before, I missed that)
> > 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.)
Newer platforms could be buggy enough. A while back, IIUC gcc moved an optimization pass from O3 to O2, which resulted in obviously bad code generation, which I know because of a bug report filed by one Andres Freund:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101481...which was never properly addressed as far as I know.
I'm a bit surprised we would even consider changing optimization level based on a build tool default.
--
John Naylor
EDB:
http://www.enterprisedb.com