0010-gnuinline.diff 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. diff --git a/gcc/toplev.c b/gcc/toplev.c
  2. index 53fcdfe..85f8504 100644
  3. --- a/gcc/toplev.c
  4. +++ b/gcc/toplev.c
  5. @@ -533,6 +533,7 @@ read_integral_parameter (const char *p, const char *pname, const int defval)
  6. #if GCC_VERSION < 3004 || !defined (__cplusplus)
  7. +#if 0
  8. /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
  9. If X is 0, return -1. */
  10. @@ -582,6 +583,7 @@ exact_log2 (unsigned HOST_WIDE_INT x)
  11. return floor_log2 (x);
  12. #endif
  13. }
  14. +#endif
  15. #endif /* GCC_VERSION < 3004 || !defined (__cplusplus) */
  16. diff --git a/gcc/toplev.h b/gcc/toplev.h
  17. index c935f7e..c8d4bb2 100644
  18. --- a/gcc/toplev.h
  19. +++ b/gcc/toplev.h
  20. @@ -152,10 +152,10 @@ extern void decode_d_option (const char *);
  21. extern bool fast_math_flags_set_p (void);
  22. /* Return log2, or -1 if not exact. */
  23. -extern int exact_log2 (unsigned HOST_WIDE_INT);
  24. +//extern int exact_log2 (unsigned HOST_WIDE_INT);
  25. /* Return floor of log2, with -1 for zero. */
  26. -extern int floor_log2 (unsigned HOST_WIDE_INT);
  27. +//extern int floor_log2 (unsigned HOST_WIDE_INT);
  28. /* Inline versions of the above for speed. */
  29. #if GCC_VERSION >= 3004
  30. @@ -170,13 +170,13 @@ extern int floor_log2 (unsigned HOST_WIDE_INT);
  31. # define CTZ_HWI __builtin_ctz
  32. # endif
  33. -extern inline int
  34. +static inline int
  35. floor_log2 (unsigned HOST_WIDE_INT x)
  36. {
  37. return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
  38. }
  39. -extern inline int
  40. +static inline int
  41. exact_log2 (unsigned HOST_WIDE_INT x)
  42. {
  43. return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;