Skip to content

Commit 5a33650

Browse files
committed
Attempt to work around a 32bit xlc compiler bug from a different place.
In de6fd1c I moved the the work around from 53f73879 into the aix template. The previous location was removed in the former commit, and I thought that it would be nice to emit a warning when running configure. That didn't turn out to work because at the point the template is included we don't know whether we're compiling a 32/64 bit binary and it's possible to install compilers for both on a 64 bit kernel/OS. So go back to a less ambitious approach and define PG_FORCE_DISABLE_INLINE in port/aix.h, without emitting a warning. We could try a more fancy approach, but it doesn't seem worth it. This requires moving the check for PG_FORCE_DISABLE_INLINE in c.h to after including the system headers included from therein which isn't perfect, as it seems slightly more robust to include all system headers in a similar environment. Oh well. Discussion: 20150807132000.GC13310@awork2.anarazel.de
1 parent c250994 commit 5a33650

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/include/c.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,6 @@
5353
#include "pg_config.h"
5454
#include "pg_config_manual.h" /* must be after pg_config.h */
5555

56-
/*
57-
* Force disable inlining if PG_FORCE_DISABLE_INLINE is defined. This is used
58-
* to work around compiler bugs and might also be useful for investigatory
59-
* purposes.
60-
*
61-
* This is done early (in slightly the wrong section) for two reasons: a) we
62-
* don't want to include headers with different settings of this b)
63-
* functionality later in this file might want to rely on inline functions.
64-
*/
65-
#ifdef PG_FORCE_DISABLE_INLINE
66-
#undef inline
67-
#define inline
68-
#endif
69-
7056
/*
7157
* We always rely on the WIN32 macro being set by our build system,
7258
* but _WIN32 is the compiler pre-defined macro. So make sure we define
@@ -115,6 +101,19 @@
115101
#include "pg_config_os.h"
116102
#endif
117103

104+
/*
105+
* Force disable inlining if PG_FORCE_DISABLE_INLINE is defined. This is used
106+
* to work around compiler bugs and might also be useful for investigatory
107+
* purposes by defining the symbol in the platform's header..
108+
*
109+
* This is done early (in slightly the wrong section) as functionality later
110+
* in this file might want to rely on inline functions.
111+
*/
112+
#ifdef PG_FORCE_DISABLE_INLINE
113+
#undef inline
114+
#define inline
115+
#endif
116+
118117
/* Must be before gettext() games below */
119118
#include <locale.h>
120119

src/include/port/aix.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,12 @@
33
*/
44
#define CLASS_CONFLICT
55
#define DISABLE_XOPEN_NLS
6+
7+
/*
8+
* "IBM XL C/C++ for AIX, V12.1" miscompiles, for 32-bit, some inline
9+
* expansions of ginCompareItemPointers() "long long" arithmetic. To take
10+
* advantage of inlining, build a 64-bit PostgreSQL.
11+
*/
12+
#if defined(__ILP32__) && defined(__IBMC__)
13+
#define PG_FORCE_DISABLE_INLINE
14+
#endif

src/template/aix

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ if test "$GCC" != yes ; then
1212
esac
1313
fi
1414

15-
# "IBM XL C/C++ for AIX, V12.1" miscompiles, for 32-bit, some inline
16-
# expansions of ginCompareItemPointers() "long long" arithmetic. To
17-
# take advantage of inlining, build a 64-bit PostgreSQL.
18-
if test "$GCC" != yes -a $(getconf HARDWARE_BITMODE) == '32'; then
19-
echo "$as_me: WARNING: disabling inlining on 32 bit aix due to a bug in xlc" 2>&1
20-
CPPFLAGS="$CPPFLAGS -DPG_FORCE_DISABLE_INLINE"
21-
fi
22-
2315
# Native memset() is faster, tested on:
2416
# AIX 5.1 and 5.2, XLC 6.0 (IBM's cc)
2517
# AIX 5.3 ML3, gcc 4.0.1

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy