RFA: Fix frv --enable-werror-always build on 64 bit hosts
Joern Rennecke
amylaar@spamcop.net
Thu Dec 2 00:29:00 GMT 2010
By using an inline function instead of a macro, warnings for 'always true'
comparisons are avoided.
cross-tested on x86_64-pc-linux-gnu and i686-pc-linux-gnu.
-------------- next part --------------
2010-12-02 Joern Rennecke <amylaar@spamcop.net>
PR target/46735
* config/frv/frv.h (IN_RANGE_P): Change into an inline function.
Index: config/frv/frv.h
===================================================================
--- config/frv/frv.h (revision 167318)
+++ config/frv/frv.h (working copy)
@@ -27,10 +27,13 @@
/* Align an address. */
#define ADDR_ALIGN(addr,align) (((addr) + (align) - 1) & ~((align) - 1))
-/* Return true if a value is inside a range. */
-#define IN_RANGE_P(VALUE, LOW, HIGH) \
- ( (((HOST_WIDE_INT)(VALUE)) >= (HOST_WIDE_INT)(LOW)) \
- && (((HOST_WIDE_INT)(VALUE)) <= ((HOST_WIDE_INT)(HIGH))))
+/* Return true if a value is inside a range. Make this an inline
+ function rather than a macro, lest we get host-dependent warnings. */
+static inline bool
+IN_RANGE_P (HOST_WIDE_INT value, HOST_WIDE_INT low, HOST_WIDE_INT high)
+{
+ return value >= low && value <= high;
+}
/* Driver configuration. */
More information about the Gcc-patches
mailing list