add psp gcc 11.2.0 patch
[rofl0r-mmix-cross.git] / patches / gcc-4.2.1-toplev.diff
blobbcbbf1f45474f636a7b583a600d403ea2d3106aa
1 --- gcc-4.2.4.orig/gcc/toplev.h
2 +++ gcc-4.2.4/gcc/toplev.h
3 @@ -150,6 +150,7 @@
4 /* Return true iff flags are set as if -ffast-math. */
5 extern bool fast_math_flags_set_p (void);
7 +#if GCC_VERSION < 3004
8 /* Return log2, or -1 if not exact. */
9 extern int exact_log2 (unsigned HOST_WIDE_INT);
11 @@ -157,7 +158,7 @@
12 extern int floor_log2 (unsigned HOST_WIDE_INT);
14 /* Inline versions of the above for speed. */
15 -#if GCC_VERSION >= 3004
16 +#else /* GCC_VERSION >= 3004 */
17 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
18 # define CLZ_HWI __builtin_clzl
19 # define CTZ_HWI __builtin_ctzl
20 @@ -169,13 +170,13 @@
21 # define CTZ_HWI __builtin_ctz
22 # endif
24 -extern inline int
25 +static inline int
26 floor_log2 (unsigned HOST_WIDE_INT x)
28 return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
31 -extern inline int
32 +static inline int
33 exact_log2 (unsigned HOST_WIDE_INT x)
35 return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
36 --- gcc-4.2.4.orig/gcc/toplev.c
37 +++ gcc-4.2.4/gcc/toplev.c
38 @@ -526,11 +526,7 @@
39 return atoi (p);
42 -/* When compiling with a recent enough GCC, we use the GNU C "extern inline"
43 - for floor_log2 and exact_log2; see toplev.h. That construct, however,
44 - conflicts with the ISO C++ One Definition Rule. */
46 -#if GCC_VERSION < 3004 || !defined (__cplusplus)
47 +#if GCC_VERSION < 3004
49 /* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
50 If X is 0, return -1. */