model-writtenrun 9323 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Martin Liška opened the thread with UBSan reports covering null arguments, CRC alignment and array-header alignment during regression tests #1.
- Tomas Vondra traced null-argument reports to zero-length library calls and described CRC misalignment as intentional on Intel, while Tom Lane identified a separate array problem: AnyArrayType requires stronger alignment than its flat ArrayType member #2 #3.
- Martin warned that nonnull declarations could enable compiler optimizations even for zero-length calls, and Tomas subsequently traced the psql warning to memset with an empty SELECT target list #4 #8.
- Investigation of separate array-output failures under GCC 8 with -O3 led Tom to reproduce malformed multidimensional output and Martin to isolate a GCC miscompilation; sanitizer instrumentation changed whether that compiler bug manifested #9 #13 #15 #16 #17.
- Andres Freund added buildfarm animals using GCC snapshots at -O0 and -O3 and updated the compiler package after the GCC fix #18.
- More than a year later, Noah Misch submitted casts that avoid accessing misaligned ExpandedObjectHeader and AnyArrayType members, reporting clean GCC 8.3.0 UBSan runs on sparc64 with nonnull-attribute checking disabled; he deliberately left zero-length null-argument calls unchanged #19.
- Tom Lane accepted the tradeoff between weaker pointer-type checking and avoiding alignment complaints or incorrect code generation, approving the patch in the thread's final message #20.
- Noah committed the attached patch unchanged as 459c3cdb4a, with backpatching to PostgreSQL 9.5; this resolved the array-alignment portion while the null-argument warnings remained outside the patch.