]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/c.m4 (AC_LANG_FUNC_LINK_TRY(C)): Initialize f=$1 rather
authorKevin Ryde <user42@zip.com.au>
Wed, 13 Nov 2002 23:34:07 +0000 (23:34 +0000)
committerKevin Ryde <user42@zip.com.au>
Wed, 13 Nov 2002 23:34:07 +0000 (23:34 +0000)
than assigning in main, to avoid HP cc +O3 optimizing it away.

ChangeLog
lib/autoconf/c.m4

index a06dc58eca7fb821d1b64af86fb329532354e403..bcfb8e3e494d5852ffce4c65a14d84b6aecae992 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-14  Kevin Ryde  <user42@zip.com.au>
+
+       * lib/autoconf/c.m4 (AC_LANG_FUNC_LINK_TRY(C)): Initialize f=$1 rather
+       than assigning in main, to avoid HP cc +O3 optimizing it away.
+
 2002-11-12  Peter Eisentraut  <peter_e@gmx.net>
 
        * lib/autoconf/status.m4 (_AC_OUTPUT_CONFIG_STATUS): Add -q
index 66bc28e648eb4d84c844a1a23d5b15837b0f6256..1c320f58a72c744e1898e2de4a8bc78fd889d859 100644 (file)
@@ -165,6 +165,11 @@ char $2 ();])], [$2 ();])])
 # Don't include <ctype.h> because on OSF/1 3.0 it includes
 # <sys/types.h> which includes <sys/select.h> which contains a
 # prototype for select.  Similarly for bzero.
+#
+# This test used to assign f=$1 in main(), but that was optimized away by HP
+# unbundled cc A.05.36 for ia64 under +O3, presumably on the basis that
+# there's no need to do that store if the program is about to exit.
+#
 m4_define([AC_LANG_FUNC_LINK_TRY(C)],
 [AC_LANG_PROGRAM(
 [/* System header to define __stub macros and hopefully few prototypes,
@@ -178,18 +183,16 @@ extern "C"
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
 char $1 ();
-char (*f) ();
-#ifdef __cplusplus
-}
-#endif
-],
-[/* The GNU C library defines this for functions which it implements
+/* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
 #if defined (__stub_$1) || defined (__stub___$1)
 choke me
 #else
-f = $1;
+char (*f) () = $1;
+#endif
+#ifdef __cplusplus
+}
 #endif
 ])])