summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/expmed.c8
-rw-r--r--gcc/hwint.c17
-rw-r--r--gcc/hwint.h9
-rw-r--r--gcc/rtl.h3
-rw-r--r--gcc/tree-phinodes.c1
7 files changed, 33 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d1ce2271b60..32080f2233c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,15 @@
2012-06-17 Steven Bosscher <steven@gcc.gnu.org>
+ * expmed.c (ceil_log2): Move from here...
+ * hwint.c: ... to here for older GCCs...
+ * hwint.h: ... and here for newer GCCs.
+ * rtl.h (ceil_log2): Remove prototype.
+
+ * tree-phinodes.c: Do not include rtl.h.
+ * Makefile.in (tree-phinodes.o): Do not depend on RTL_H.
+
+2012-06-17 Steven Bosscher <steven@gcc.gnu.org>
+
* config/cris/cris.h (TARGET_ELF): Remove.
(FORCE_EH_FRAME_INFO_IN_DATA_SECTION): Remove.
(CRIS_ASM_OUTPUT_ALIGNED_DECL_COMMON): Simpify using TARGET_ELF==1.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a404a5f3e41..32190ec90f1 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2410,7 +2410,7 @@ tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_PASS_H)
tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
- gt-tree-phinodes.h $(RTL_H) $(DIAGNOSTIC_CORE_H) $(GIMPLE_H)
+ gt-tree-phinodes.h $(DIAGNOSTIC_CORE_H) $(GIMPLE_H)
domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(BASIC_BLOCK_H) domwalk.h sbitmap.h
tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
diff --git a/gcc/expmed.c b/gcc/expmed.c
index b456bac177c..9f5f6a207ae 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3267,14 +3267,6 @@ expand_widening_mult (enum machine_mode mode, rtx op0, rtx op1, rtx target,
unsignedp, OPTAB_LIB_WIDEN);
}
-/* Return the smallest n such that 2**n >= X. */
-
-int
-ceil_log2 (unsigned HOST_WIDE_INT x)
-{
- return floor_log2 (x - 1) + 1;
-}
-
/* Choose a minimal N + 1 bit approximation to 1/D that can be used to
replace division by D, and put the least significant N bits of the result
in *MULTIPLIER_PTR and return the most significant bit.
diff --git a/gcc/hwint.c b/gcc/hwint.c
index 533133c7b4d..bfc5e3dedcd 100644
--- a/gcc/hwint.c
+++ b/gcc/hwint.c
@@ -25,10 +25,11 @@ along with GCC; see the file COPYING3. If not see
#if GCC_VERSION < 3004
-/* The functions clz_hwi, ctz_hwi, ffs_hwi, floor_log2 and exact_log2
- are defined as inline functions in hwint.h if GCC_VERSION >= 3004.
- The definitions here are used for older versions of GCC and non-GCC
- bootstrap compilers. */
+/* The functions clz_hwi, ctz_hwi, ffs_hwi, floor_log2, ceil_log2,
+ and exact_log2 are defined as inline functions in hwint.h
+ if GCC_VERSION >= 3004.
+ The definitions here are used for older versions of GCC and
+ non-GCC bootstrap compilers. */
/* Given X, an unsigned number, return the largest int Y such that 2**Y <= X.
If X is 0, return -1. */
@@ -61,6 +62,14 @@ floor_log2 (unsigned HOST_WIDE_INT x)
return t;
}
+/* Given X, an unsigned number, return the largest Y such that 2**Y >= X. */
+
+int
+ceil_log2 (unsigned HOST_WIDE_INT x)
+{
+ return floor_log2 (x - 1) + 1;
+}
+
/* Return the logarithm of X, base 2, considering X unsigned,
if X is a power of 2. Otherwise, returns -1. */
diff --git a/gcc/hwint.h b/gcc/hwint.h
index 17346392f91..00c9538fb11 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -185,6 +185,9 @@ extern int exact_log2 (unsigned HOST_WIDE_INT);
/* Return floor of log2, with -1 for zero. */
extern int floor_log2 (unsigned HOST_WIDE_INT);
+/* Return the smallest n such that 2**n >= X. */
+extern int ceil_log2 (unsigned HOST_WIDE_INT);
+
#else /* GCC_VERSION >= 3004 */
/* For convenience, define 0 -> word_size. */
@@ -235,6 +238,12 @@ floor_log2 (unsigned HOST_WIDE_INT x)
}
static inline int
+ceil_log2 (unsigned HOST_WIDE_INT x)
+{
+ return floor_log2 (x - 1) + 1;
+}
+
+static inline int
exact_log2 (unsigned HOST_WIDE_INT x)
{
return x == (x & -x) && x ? ctz_hwi (x) : -1;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 1d71971335a..f9864cb4847 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1638,9 +1638,6 @@ extern int currently_expanding_to_rtl;
/* Generally useful functions. */
-/* In expmed.c */
-extern int ceil_log2 (unsigned HOST_WIDE_INT);
-
/* In explow.c */
extern HOST_WIDE_INT trunc_int_for_mode (HOST_WIDE_INT, enum machine_mode);
extern rtx plus_constant (enum machine_mode, rtx, HOST_WIDE_INT);
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index bd0bde399e1..6408a525298 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "rtl.h" /* FIXME: Only for ceil_log2, of all things... */
#include "ggc.h"
#include "basic-block.h"
#include "tree-flow.h"