Re: gcc 13 warnings - Mailing list pgsql-hackers

From John Naylor
Subject Re: gcc 13 warnings
Date
Msg-id CAFBsxsEyzigJp451jUzssRn1XZxGhUE5XprS59ps7kEA8G14KQ@mail.gmail.com
Whole thread Raw
In response to Re: gcc 13 warnings  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: Assert failure of the cross-check for nullingrels
Next
From: Richard Guo
Date:
Subject: Re: A problem about ParamPathInfo for an AppendPath