summaryrefslogtreecommitdiff
path: root/gcc/hwint.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-21 18:32:23 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-21 18:32:23 +0000
commit473bcb8e6989069c0c201b204a03f5af1143f9f4 (patch)
treec428c7e73d5606ac395dd73b9723b83e18d58202 /gcc/hwint.h
parenta3eced2addbc6c7c5cc09609fb7965d597744153 (diff)
downloadgcc-473bcb8e6989069c0c201b204a03f5af1143f9f4.tar.gz
gcc/
* system.h: Move hwint.h include further down. * hwint.h (sext_hwi, zext_hwi): Define unconditionally. Add gcc_checking_asserts. * hwint.c (sext_hwi, zext_hwi): Delete ENABLE_CHECKING versions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203906 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/hwint.h')
-rw-r--r--gcc/hwint.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/hwint.h b/gcc/hwint.h
index d2c2ec377b0..77ae64224f7 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -322,9 +322,6 @@ extern HOST_WIDE_INT least_common_multiple (HOST_WIDE_INT, HOST_WIDE_INT);
/* Sign extend SRC starting from PREC. */
-#ifdef ENABLE_CHECKING
-extern HOST_WIDE_INT sext_hwi (HOST_WIDE_INT, unsigned int);
-#else
static inline HOST_WIDE_INT
sext_hwi (HOST_WIDE_INT src, unsigned int prec)
{
@@ -332,24 +329,23 @@ sext_hwi (HOST_WIDE_INT src, unsigned int prec)
return src;
else
{
+ gcc_checking_assert (prec < HOST_BITS_PER_WIDE_INT);
int shift = HOST_BITS_PER_WIDE_INT - prec;
return (src << shift) >> shift;
}
}
-#endif
/* Zero extend SRC starting from PREC. */
-#ifdef ENABLE_CHECKING
-extern unsigned HOST_WIDE_INT zext_hwi (unsigned HOST_WIDE_INT, unsigned int);
-#else
static inline unsigned HOST_WIDE_INT
zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec)
{
if (prec == HOST_BITS_PER_WIDE_INT)
return src;
else
- return src & (((HOST_WIDE_INT)1 << prec) - 1);
+ {
+ gcc_checking_assert (prec < HOST_BITS_PER_WIDE_INT);
+ return src & (((HOST_WIDE_INT) 1 << prec) - 1);
+ }
}
-#endif
#endif /* ! GCC_HWINT_H */