model-writtenrun 2196 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane reported a GCC 15 warning at -O3 caused by inlining assign_simple_var() into exec_set_found(), and found that asserting the boolean variable's type length suppressed it only in assertion-enabled builds #1.
- Tom Lane then tried an explicit null-pointer check, which produced two copies of the warning and strengthened his suspicion of a compiler bug; that workaround was not adopted #2.
- Andres Freund explained that the compiler appeared to interpret a boolean as a pointer, noted that older GCC versions also exhibited the warning, and proposed a pg_assume(expr) wrapper to communicate the missing invariant #3.
- Andres Freund submitted two patches introducing pg_assume() and using it to tell the compiler that the FOUND variable cannot be a varlena; the macro asserts in assertion-enabled builds and supplies compiler assumptions where supported otherwise #4.
- Tom Lane found the series plausible by inspection and requested a comment typo correction #5, while jian he subsequently confirmed that the patches eliminated the warning with gcc-14.0 and registered the work in the CommitFest #6.
- Andres Freund committed the macro with the typo corrected as d65eb5b1b8 and its exec_set_found() use with a polished explanatory comment as 48a23f6eae, preserving the implementation from #4; he announced the commits and closure of the CommitFest entry in #7 and #8.
- The thread reopened when Tristan Partin reproduced the warning on REL_18_STABLE with GCC 16.2.0 on Amazon Linux 2023 using a Meson release build and asked whether the fixes should have been backpatched; the supplied thread ends with that question unanswered #9.