From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: marxin.liska@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15121: Multiple UBSAN errors
Date: Sun, 30 Jun 2019 14:52:44 -0400
Message-ID: <15737.1561920764@sss.pgh.pa.us> (raw)
In-Reply-To: <20190629210334.GA1244217@rfd.leadboat.com>
References: <152140318583.11955.7731957058248462341@wrigleys.postgresql.org>
<7df78014-c931-6c75-6f92-ec48f390b2b9@2ndquadrant.com>
<20078.1521421379@sss.pgh.pa.us>
<20190629210334.GA1244217@rfd.leadboat.com>
Noah Misch <noah@leadboat.com> writes:
> On Sun, Mar 18, 2018 at 09:02:59PM -0400, Tom Lane wrote:
>> What I think might be happening is that the compiler is taking the
>> fact that the pointer is declared as AnyArrayType *, where ...
>> to assume that the pointer must be aligned on an 8-byte boundary because
>> ExpandedArrayHeader would require that, even if we're only accessing the
>> "flt" member.
> Yep.
> Using different casts, as attached, silences these complaints without much
> change in code cosmetics.
I'd intentionally avoided using casts this way as an attempt to ensure
that these macros weren't accidentally applied to the wrong kind of
pointer. However, avoiding UBSAN complaints (and perhaps wrong code
generation) seems like a more important goal. This patch looks OK to me.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, noah@leadboat.com, tomas.vondra@2ndquadrant.com, marxin.liska@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15121: Multiple UBSAN errors
In-Reply-To: <15737.1561920764@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox