On 14.07.22 12:05, Peter Eisentraut wrote:
On 13.07.22 20:24, Tom Lane wrote:
Peter Eisentraut <[email protected]> writes:
What platforms did this fail on?  How can one observe the failure locally?

wrasse at least:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=wrasse&dt=2022-07-13%2014%3A49%3A17

I think possibly you could duplicate the problem with gcc
by using -fkeep-inline-functions, but I've not tried.

Confirmed, -fkeep-inline-functions will catch it.  Good to know.

It seems that -fkeep-inline-functions is more demanding than what wrasse is running on. I need the attached patch to get it to build cleanly.

(The first hunk undoes some parts of 2cd2569c72b8920048e35c31c9be30a6170e1410, but the others are unrelated and old.)

I think this would be good to apply so that this method of checking inline functions is available in the future.
From 9e57d1d42490ac37e8bd27804a6180ddee0fbf53 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <[email protected]>
Date: Thu, 14 Jul 2022 15:54:40 +0200
Subject: [PATCH] WIP: Support gcc -fkeep-inline-functions

---
 src/include/storage/bufpage.h | 24 +++++++++---------------
 src/include/utils/rel.h       |  2 ++
 src/include/utils/snapmgr.h   |  2 ++
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index fc67d396b6..6a947021ac 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -466,6 +466,15 @@ do { \
 #define PIV_LOG_WARNING                        (1 << 0)
 #define PIV_REPORT_STAT                        (1 << 1)
 
+#define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \
+       PageAddItemExtended(page, item, size, offsetNumber, \
+                                               ((overwrite) ? PAI_OVERWRITE : 
0) | \
+                                               ((is_heap) ? PAI_IS_HEAP : 0))
+
+#define PageIsVerified(page, blkno) \
+       PageIsVerifiedExtended(page, blkno, \
+                                                  PIV_LOG_WARNING | 
PIV_REPORT_STAT)
+
 /*
  * Check that BLCKSZ is a multiple of sizeof(size_t).  In
  * PageIsVerifiedExtended(), it is much faster to check if a page is
@@ -480,21 +489,6 @@ extern void PageInit(Page page, Size pageSize, Size 
specialSize);
 extern bool PageIsVerifiedExtended(Page page, BlockNumber blkno, int flags);
 extern OffsetNumber PageAddItemExtended(Page page, Item item, Size size,
                                                                                
OffsetNumber offsetNumber, int flags);
-
-static inline OffsetNumber
-PageAddItem(Page page, Item item, Size size, OffsetNumber offsetNumber, bool 
overwrite, bool is_heap)
-{
-       return PageAddItemExtended(page, item, size, offsetNumber,
-                                                          (overwrite ? 
PAI_OVERWRITE : 0) |
-                                                          (is_heap ? 
PAI_IS_HEAP : 0));
-}
-
-static inline bool
-PageIsVerified(Page page, BlockNumber blkno)
-{
-       return PageIsVerifiedExtended(page, blkno, PIV_LOG_WARNING | 
PIV_REPORT_STAT);
-}
-
 extern Page PageGetTempPage(Page page);
 extern Page PageGetTempPageCopy(Page page);
 extern Page PageGetTempPageCopySpecial(Page page);
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 2854839ec2..00b83b8924 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -564,6 +564,7 @@ typedef struct ViewOptions
  * each time you need to access the SMgrRelation.  It's quite cheap in
  * comparison to whatever an smgr function is going to do.
  */
+#ifndef FRONTEND
 static inline SMgrRelation
 RelationGetSmgr(Relation rel)
 {
@@ -571,6 +572,7 @@ RelationGetSmgr(Relation rel)
                smgrsetowner(&(rel->rd_smgr), smgropen(rel->rd_locator, 
rel->rd_backend));
        return rel->rd_smgr;
 }
+#endif
 
 /*
  * RelationCloseSmgr
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 67b217b1c1..06eafdf118 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -97,11 +97,13 @@ extern PGDLLIMPORT SnapshotData CatalogSnapshotData;
        ((snapshot)->snapshot_type == SNAPSHOT_MVCC || \
         (snapshot)->snapshot_type == SNAPSHOT_HISTORIC_MVCC)
 
+#ifndef FRONTEND
 static inline bool
 OldSnapshotThresholdActive(void)
 {
        return old_snapshot_threshold >= 0;
 }
+#endif
 
 extern Snapshot GetTransactionSnapshot(void);
 extern Snapshot GetLatestSnapshot(void);
-- 
2.37.0

Reply via email to