aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/executor/nodeHashjoin.c3
-rw-r--r--src/include/c.h17
2 files changed, 13 insertions, 7 deletions
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index 8f2b634b124..03d78042fa0 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -161,8 +161,7 @@ static void ExecParallelHashJoinPartitionOuter(HashJoinState *node);
* the other one is "outer".
* ----------------------------------------------------------------
*/
-pg_attribute_always_inline
-static inline TupleTableSlot *
+static pg_attribute_always_inline TupleTableSlot *
ExecHashJoinImpl(PlanState *pstate, bool parallel)
{
HashJoinState *node = castNode(HashJoinState, pstate);
diff --git a/src/include/c.h b/src/include/c.h
index 34a7fa67b45..9b7fe87f32b 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -146,14 +146,21 @@
#define pg_attribute_noreturn()
#endif
-/* GCC, Sunpro and XLC support always_inline via __attribute__ */
-#if defined(__GNUC__)
-#define pg_attribute_always_inline __attribute__((always_inline))
-/* msvc via a special keyword */
+/*
+ * Use "pg_attribute_always_inline" in place of "inline" for functions that
+ * we wish to force inlining of, even when the compiler's heuristics would
+ * choose not to. But, if possible, don't force inlining in unoptimized
+ * debug builds.
+ */
+#if (defined(__GNUC__) && __GNUC__ > 3 && defined(__OPTIMIZE__)) || defined(__SUNPRO_C) || defined(__IBMC__)
+/* GCC > 3, Sunpro and XLC support always_inline via __attribute__ */
+#define pg_attribute_always_inline __attribute__((always_inline)) inline
#elif defined(_MSC_VER)
+/* MSVC has a special keyword for this */
#define pg_attribute_always_inline __forceinline
#else
-#define pg_attribute_always_inline
+/* Otherwise, the best we can do is to say "inline" */
+#define pg_attribute_always_inline inline
#endif
/*