PATCH: Don't include <bits/mathinline.h> if __NO_MATH_INLINES is defined
H.J. Lu
hongjiu.lu@intel.com
Fri Sep 16 11:52:00 GMT 2011
On Thu, Sep 15, 2011 at 10:14:59PM -0700, H.J. Lu wrote:
> Hi,
>
> GCC 4.7 failed to compile math/test-tgmath.o and math/test-tgmath2.o
> on Linux/x86-64:
>
> test-tgmath.c: In function âmainâ:
> test-tgmath.c:698:4: error: inlining failed in call to always_inline
> âlrintâ: function not inlinable
> test-tgmath.c:267:7: error: called from here
> test-tgmath.c:714:4: error: inlining failed in call to always_inline
> âllrintâ: function not inlinable
> test-tgmath.c:268:7: error: called from here
> In file included from test-tgmath.c:201:0:
> test-tgmath.c:698:1: error: inlining failed in call to always_inline
> âlrintfâ: function not inlinable
> test-tgmath.c:267:7: error: called from here
> test-tgmath.c:714:1: error: inlining failed in call to always_inline
> âllrintfâ: function not inlinable
> test-tgmath.c:268:7: error: called from here
>
> It defines __NO_MATH_INLINES. But <bits/mathinline.h> is still
> included. This patch fixes it.
>
>
> H.J.
> ----
> 2011-09-15 H.J. Lu <hongjiu.lu@intel.com>
>
> * math/math.h: Don't include <bits/mathinline.h> if
> __NO_MATH_INLINES is defined.
>
When __LIBC_INTERNAL_MATH_INLINES is defined, <bits/mathinline.h>
should be included since libm is compiled with
-D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES
H.J.
---
2011-09-15 H.J. Lu <hongjiu.lu@intel.com>
* math/math.h: Include <bits/mathinline.h> if
__LIBC_INTERNAL_MATH_INLINES is defined or __NO_MATH_INLINES
isn't defined.
diff --git a/math/math.h b/math/math.h
index aeb54d9..f6f9fbc 100644
--- a/math/math.h
+++ b/math/math.h
@@ -412,7 +412,8 @@ extern int matherr (struct exception *__exc);
#endif
/* Get machine-dependent inline versions (if there are any). */
-#ifdef __USE_EXTERN_INLINES
+#if defined __USE_EXTERN_INLINES \
+ && (defined __LIBC_INTERNAL_MATH_INLINES || !defined __NO_MATH_INLINES)
# include <bits/mathinline.h>
#endif
More information about the Libc-alpha
mailing list