Skip to content

Commit 61091ec

Browse files
committed
Intel compiler has a bug/misoptimization in checking for division by NAN
(NaN == 0), -mp1 fixes it, so add it to the CFLAGS. Autoconf run. Jeremy Drake
1 parent a1ee621 commit 61091ec

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

configure

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,6 +2871,63 @@ else
28712871
echo "$as_me: failed program was:" >&5
28722872
sed 's/^/| /' conftest.$ac_ext >&5
28732873

2874+
CFLAGS="$pgac_save_CFLAGS"
2875+
echo "$as_me:$LINENO: result: no" >&5
2876+
echo "${ECHO_T}no" >&6
2877+
fi
2878+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
2879+
2880+
else
2881+
# Intel compiler has a bug/misoptimization in checking for
2882+
# division by NAN (NaN == 0), -mp1 fixes it, so add it to the
2883+
# CFLAGS.
2884+
echo "$as_me:$LINENO: checking if $CC supports -mp1" >&5
2885+
echo $ECHO_N "checking if $CC supports -mp1... $ECHO_C" >&6
2886+
pgac_save_CFLAGS=$CFLAGS
2887+
CFLAGS="$pgac_save_CFLAGS -mp1"
2888+
cat >conftest.$ac_ext <<_ACEOF
2889+
/* confdefs.h. */
2890+
_ACEOF
2891+
cat confdefs.h >>conftest.$ac_ext
2892+
cat >>conftest.$ac_ext <<_ACEOF
2893+
/* end confdefs.h. */
2894+
2895+
int
2896+
main ()
2897+
{
2898+
2899+
;
2900+
return 0;
2901+
}
2902+
_ACEOF
2903+
rm -f conftest.$ac_objext
2904+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2905+
(eval $ac_compile) 2>conftest.er1
2906+
ac_status=$?
2907+
grep -v '^ *+' conftest.er1 >conftest.err
2908+
rm -f conftest.er1
2909+
cat conftest.err >&5
2910+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
2911+
(exit $ac_status); } &&
2912+
{ ac_try='test -z "$ac_c_werror_flag"
2913+
|| test ! -s conftest.err'
2914+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2915+
(eval $ac_try) 2>&5
2916+
ac_status=$?
2917+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
2918+
(exit $ac_status); }; } &&
2919+
{ ac_try='test -s conftest.$ac_objext'
2920+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2921+
(eval $ac_try) 2>&5
2922+
ac_status=$?
2923+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
2924+
(exit $ac_status); }; }; then
2925+
echo "$as_me:$LINENO: result: yes" >&5
2926+
echo "${ECHO_T}yes" >&6
2927+
else
2928+
echo "$as_me: failed program was:" >&5
2929+
sed 's/^/| /' conftest.$ac_ext >&5
2930+
28742931
CFLAGS="$pgac_save_CFLAGS"
28752932
echo "$as_me:$LINENO: result: no" >&5
28762933
echo "${ECHO_T}no" >&6

configure.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.461 2006/04/27 14:27:04 momjian Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.462 2006/04/29 00:51:41 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -263,6 +263,11 @@ choke me
263263
# Check whether they are supported, and add them to CFLAGS if so.
264264
PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
265265
PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
266+
else
267+
# Intel compiler has a bug/misoptimization in checking for
268+
# division by NAN (NaN == 0), -mp1 fixes it, so add it to the
269+
# CFLAGS.
270+
PGAC_PROG_CC_CFLAGS_OPT([-mp1])
266271
fi
267272

268273
# Disable strict-aliasing rules; needed for gcc 3.3+

0 commit comments

Comments
 (0)