With AIX xlc v16.1.0, various compilations get internal errors:

/opt/IBM/xlc/16.1.0/bin/xlc_r -qmaxmem=33554432 -qnoansialias -g -O2 -qsrcmsg 
-I/scratch/nm/farmlike/../cmpx/src/interfaces/libpq -I../../../src/include 
-I/scratch/nm/farmlike/../cmpx/src/include    -c -o pg_backup_utils.o 
/scratch/nm/farmlike/../cmpx/src/bin/pg_dump/pg_backup_utils.c
/opt/IBM/xlc/16.1.0/bin/.orig/xlc_r: 1501-230 (S) Internal compiler error; 
please contact your Service Representative. For more information visit:
http://www.ibm.com/support/docview.wss?uid=swg21110810

I tracked this down to our use of -qsrcmsg, which I plan to remove from the
default CFLAGS, including back branches.  While this is a compiler bug, it's
not worth breaking plausible builds to default-enable the minor change
-qsrcmsg provides:

$ echo 'break me' >x.c
$ /opt/IBM/xlc/16.1.0/bin/xlc_r x.c
"x.c", line 1.1: 1506-275 (S) Unexpected text 'break' encountered.
"x.c", line 1.7: 1506-166 (S) Definition of function me requires parentheses.
"x.c", line 1.9: 1506-204 (S) Unexpected end of file.
$ /opt/IBM/xlc/16.1.0/bin/xlc_r -qsrcmsg x.c
        1 | break me
            a.....b.c
a - 1506-275 (S) Unexpected text 'break' encountered.
b - 1506-166 (S) Definition of function me requires parentheses.
c - 1506-204 (S) Unexpected end of file.
diff --git a/src/template/aix b/src/template/aix
index ed83284..999cd35 100644
--- a/src/template/aix
+++ b/src/template/aix
@@ -1,13 +1,14 @@
-# Set appropriate default compiler options if using xlc
-# Note: configure will add -qnoansialias if the compiler accepts it,
-# even if user specifies a non-default CFLAGS setting.
+# Set default options if using xlc.  This formerly included -qsrcmsg, but that
+# option elicits internal compiler errors from xlc v16.1.0.  Note: configure
+# will add -qnoansialias if the compiler accepts it, even if user specifies a
+# non-default CFLAGS setting.
 if test "$GCC" != yes ; then
   case $host_os in
     aix3.2.5 | aix4.1*)
-      CFLAGS="-O -qmaxmem=16384 -qsrcmsg"
+      CFLAGS="-O -qmaxmem=16384"
       ;;
     *)
-      CFLAGS="-O2 -qmaxmem=16384 -qsrcmsg"
+      CFLAGS="-O2 -qmaxmem=16384"
       ;;
   esac
 

Reply via email to