From b4327a1869bb695bba75b72993c1510544d79fe4 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 9 Jun 2025 17:11:37 +0900 Subject: [PATCH] Simplify gcc-related tweak in VARATT_EXTERNAL_GET_POINTER() Introduced in b89e151054a0. --- src/include/access/detoast.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/include/access/detoast.h b/src/include/access/detoast.h index e603a2276c38..7928f4d3012c 100644 --- a/src/include/access/detoast.h +++ b/src/include/access/detoast.h @@ -14,17 +14,13 @@ /* * Macro to fetch the possibly-unaligned contents of an EXTERNAL datum - * into a local "struct varatt_external" toast pointer. This should be - * just a memcpy, but some versions of gcc seem to produce broken code - * that assumes the datum contents are aligned. Introducing an explicit - * intermediate "varattrib_1b_e *" variable seems to fix it. + * into a local "struct varatt_external" toast pointer. */ #define VARATT_EXTERNAL_GET_POINTER(toast_pointer, attr) \ do { \ - varattrib_1b_e *attre = (varattrib_1b_e *) (attr); \ - Assert(VARATT_IS_EXTERNAL(attre)); \ - Assert(VARSIZE_EXTERNAL(attre) == sizeof(toast_pointer) + VARHDRSZ_EXTERNAL); \ - memcpy(&(toast_pointer), VARDATA_EXTERNAL(attre), sizeof(toast_pointer)); \ + Assert(VARATT_IS_EXTERNAL(attr)); \ + Assert(VARSIZE_EXTERNAL(attr) == sizeof(toast_pointer) + VARHDRSZ_EXTERNAL); \ + memcpy(&(toast_pointer), VARDATA_EXTERNAL(attr), sizeof(toast_pointer)); \ } while (0) /* Size of an EXTERNAL datum that contains a standard TOAST pointer */