mirror of git://gcc.gnu.org/git/gcc.git
system.h: Move hwint.h include further down.
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. From-SVN: r203906
This commit is contained in:
parent
0a873daac0
commit
67b5215c76
|
|
@ -1,3 +1,10 @@
|
||||||
|
2013-10-21 Richard Sandiford <rdsandiford@googlemail.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2013-10-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
2013-10-21 Bernd Edlinger <bernd.edlinger@hotmail.de>
|
||||||
|
|
||||||
Fix volatile issues in optimize_bit_field_compare.
|
Fix volatile issues in optimize_bit_field_compare.
|
||||||
|
|
|
||||||
32
gcc/hwint.c
32
gcc/hwint.c
|
|
@ -204,35 +204,3 @@ least_common_multiple (HOST_WIDE_INT a, HOST_WIDE_INT b)
|
||||||
{
|
{
|
||||||
return mul_hwi (abs_hwi (a) / gcd (a, b), abs_hwi (b));
|
return mul_hwi (abs_hwi (a) / gcd (a, b), abs_hwi (b));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_CHECKING
|
|
||||||
/* Sign extend SRC starting from PREC. */
|
|
||||||
|
|
||||||
HOST_WIDE_INT
|
|
||||||
sext_hwi (HOST_WIDE_INT src, unsigned int prec)
|
|
||||||
{
|
|
||||||
gcc_checking_assert (prec <= HOST_BITS_PER_WIDE_INT);
|
|
||||||
|
|
||||||
if (prec == HOST_BITS_PER_WIDE_INT)
|
|
||||||
return src;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int shift = HOST_BITS_PER_WIDE_INT - prec;
|
|
||||||
return (src << shift) >> shift;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Zero extend SRC starting from PREC. */
|
|
||||||
|
|
||||||
unsigned HOST_WIDE_INT
|
|
||||||
zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec)
|
|
||||||
{
|
|
||||||
gcc_checking_assert (prec <= HOST_BITS_PER_WIDE_INT);
|
|
||||||
|
|
||||||
if (prec == HOST_BITS_PER_WIDE_INT)
|
|
||||||
return src;
|
|
||||||
else
|
|
||||||
return src & (((HOST_WIDE_INT)1 << prec) - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
||||||
14
gcc/hwint.h
14
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. */
|
/* 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
|
static inline HOST_WIDE_INT
|
||||||
sext_hwi (HOST_WIDE_INT src, unsigned int prec)
|
sext_hwi (HOST_WIDE_INT src, unsigned int prec)
|
||||||
{
|
{
|
||||||
|
|
@ -332,24 +329,23 @@ sext_hwi (HOST_WIDE_INT src, unsigned int prec)
|
||||||
return src;
|
return src;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
gcc_checking_assert (prec < HOST_BITS_PER_WIDE_INT);
|
||||||
int shift = HOST_BITS_PER_WIDE_INT - prec;
|
int shift = HOST_BITS_PER_WIDE_INT - prec;
|
||||||
return (src << shift) >> shift;
|
return (src << shift) >> shift;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Zero extend SRC starting from PREC. */
|
/* 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
|
static inline unsigned HOST_WIDE_INT
|
||||||
zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec)
|
zext_hwi (unsigned HOST_WIDE_INT src, unsigned int prec)
|
||||||
{
|
{
|
||||||
if (prec == HOST_BITS_PER_WIDE_INT)
|
if (prec == HOST_BITS_PER_WIDE_INT)
|
||||||
return src;
|
return src;
|
||||||
else
|
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 */
|
#endif /* ! GCC_HWINT_H */
|
||||||
|
|
|
||||||
|
|
@ -273,9 +273,6 @@ extern int errno;
|
||||||
# include <limits.h>
|
# include <limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Get definitions of HOST_WIDE_INT and HOST_WIDEST_INT. */
|
|
||||||
#include "hwint.h"
|
|
||||||
|
|
||||||
/* A macro to determine whether a VALUE lies inclusively within a
|
/* A macro to determine whether a VALUE lies inclusively within a
|
||||||
certain range without evaluating the VALUE more than once. This
|
certain range without evaluating the VALUE more than once. This
|
||||||
macro won't warn if the VALUE is unsigned and the LOWER bound is
|
macro won't warn if the VALUE is unsigned and the LOWER bound is
|
||||||
|
|
@ -1063,4 +1060,7 @@ helper_const_non_const_cast (const char *p)
|
||||||
#define DEBUG_VARIABLE
|
#define DEBUG_VARIABLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Get definitions of HOST_WIDE_INT and HOST_WIDEST_INT. */
|
||||||
|
#include "hwint.h"
|
||||||
|
|
||||||
#endif /* ! GCC_SYSTEM_H */
|
#endif /* ! GCC_SYSTEM_H */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue