model-writtenrun 6369 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported that development GCC optimized away pgbench's signed-overflow checks despite -fwrapv, and proposed replacing arithmetic comparisons with explicit overflow-checking helpers in #1.
- Tom Lane reported that the patch allowed check-world to pass without -fwrapv, but cautioned that this did not justify removing the compiler option because untested overflow assumptions could remain #2.
- Fabien COELHO confirmed the fix with pgbench TAP tests and check-world, including builds without -fwrapv, and supplied a revision adding unlikely() to both error conditions #3.
- Tom Lane committed #3 with only whitespace adjustment as 01697e92a4 and confirmed accepting the branch hints despite doubts about measurable benefit #4; the commit limited backpatching to v12 and newer to avoid introducing the first client-side use of these helpers in v11.
- Fabien COELHO reported filing the GCC bug in #5 and announced its upstream fix less than ten hours later in #6.
- With the pgbench fix landed, Andres Freund cautioned that passing tests without -fwrapv did not establish overflow safety and suggested a buildfarm animal using UBSan overflow checking; broader overflow detection remained an open follow-up #7.