aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-08-31 18:10:04 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2015-08-31 18:10:04 -0400
commit123c9d2fc1fe0a8ee676d8244198b34a5e99ea90 (patch)
treec1e66a666c2a035892bc1dec23b015d4c812ec02 /src/backend/tcop/postgres.c
parent049a7799dfce096923da27a9b0e4a3c7a0a47104 (diff)
downloadpostgresql-123c9d2fc1fe0a8ee676d8244198b34a5e99ea90.tar.gz
postgresql-123c9d2fc1fe0a8ee676d8244198b34a5e99ea90.zip
Clean up icc + ia64 situation.
Some googling turned up multiple sources saying that older versions of icc do not accept gcc-compatible asm blocks on IA64, though asm does work on x86[_64]. This is apparently fixed as of icc version 12.0 or so, but that doesn't help us much; if we have to carry the extra implementation anyway, we may as well just use it for icc rather than add a compiler version test. Hence, revert commit 2c713d6ea29c91cd2cbd92fa801a61e55ea2a3c4 (though I separated the icc code from the gcc code completely, producing what seems cleaner code). Document the state of affairs more explicitly, both in s_lock.h and postgres.c, and make some cosmetic adjustments around the IA64 code in s_lock.h.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index d6a15c1b370..d917af36749 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -2998,6 +2998,10 @@ ProcessInterrupts(void)
* IA64-specific code to fetch the AR.BSP register for stack depth checks.
*
* We currently support gcc, icc, and HP-UX's native compiler here.
+ *
+ * Note: while icc accepts gcc asm blocks on x86[_64], this is not true on
+ * ia64 (at least not in icc versions before 12.x). So we have to carry a
+ * separate implementation for it.
*/
#if defined(__ia64__) || defined(__ia64)
@@ -3005,8 +3009,12 @@ ProcessInterrupts(void)
/* Assume it's HP-UX native compiler */
#include <ia64/sys/inline.h>
#define ia64_get_bsp() ((char *) (_Asm_mov_from_ar(_AREG_BSP, _NO_FENCE)))
+#elif defined(__INTEL_COMPILER)
+/* icc */
+#include <asm/ia64regs.h>
+#define ia64_get_bsp() ((char *) __getReg(_IA64_REG_AR_BSP))
#else
-/* Use inline assembly; works with gcc and icc */
+/* gcc */
static __inline__ char *
ia64_get_bsp(void)
{