summaryrefslogtreecommitdiffstats
path: root/gcc/c-family
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 14:52:19 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-18 14:52:19 +0000
commit6a0712d4ee92fb8ddf409de894393962bb54cbbf (patch)
tree586ec6bfb385ba75fc95f0a7d521c0b51c136124 /gcc/c-family
parentfcb97e84adcb5693684d9cfa7b2a97af32ba7a45 (diff)
downloadppe42-gcc-6a0712d4ee92fb8ddf409de894393962bb54cbbf.tar.gz
ppe42-gcc-6a0712d4ee92fb8ddf409de894393962bb54cbbf.zip
gcc/ada/
* gcc-interface/decl.c, gcc-interface/utils.c, gcc-interface/utils2.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c-family/ * c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/c/ * c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/cp/ * call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/objc/ * objc-encoding.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. gcc/ * alias.c, asan.c, builtins.c, cfgexpand.c, cgraph.c, config/aarch64/aarch64.c, config/alpha/predicates.md, config/arm/arm.c, config/darwin.c, config/epiphany/epiphany.c, config/i386/i386.c, config/iq2000/iq2000.c, config/m32c/m32c-pragma.c, config/mep/mep-pragma.c, config/mips/mips.c, config/picochip/picochip.c, config/rs6000/rs6000.c, cppbuiltin.c, dbxout.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, fold-const.c, function.c, gimple-fold.c, godump.c, ipa-cp.c, ipa-prop.c, omp-low.c, predict.c, sdbout.c, stor-layout.c, trans-mem.c, tree-object-size.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-forwprop.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-strlen.c, tree-stdarg.c, tree-switch-conversion.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, varasm.c: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204961 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-common.c16
-rw-r--r--gcc/c-family/c-cppbuiltin.c4
3 files changed, 15 insertions, 10 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 6a5c401461b..3900b4de47b 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,5 +1,10 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+ * c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with
+ tree_to_uhwi throughout.
+
+2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
+
* c-common.c, c-format.c, c-omp.c, c-pretty-print.c: Replace
tree_low_cst (..., 0) with tree_to_shwi throughout.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index b3995bef7b5..7761494cbaa 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -8484,7 +8484,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
}
/* Get the vector size (in bytes). */
- vecsize = tree_low_cst (size, 1);
+ vecsize = tree_to_uhwi (size);
/* We need to provide for vector pointers, vector arrays, and
functions returning vectors. For example:
@@ -8517,7 +8517,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
- if (vecsize % tree_low_cst (TYPE_SIZE_UNIT (type), 1))
+ if (vecsize % tree_to_uhwi (TYPE_SIZE_UNIT (type)))
{
error ("vector size not an integral multiple of component size");
return NULL;
@@ -8530,7 +8530,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
}
/* Calculate how many units fit in the vector. */
- nunits = vecsize / tree_low_cst (TYPE_SIZE_UNIT (type), 1);
+ nunits = vecsize / tree_to_uhwi (TYPE_SIZE_UNIT (type));
if (nunits & (nunits - 1))
{
error ("number of components of the vector not a power of two");
@@ -10149,7 +10149,7 @@ sync_resolve_size (tree function, vec<tree, va_gc> *params)
if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
goto incompatible;
- size = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
+ size = tree_to_uhwi (TYPE_SIZE_UNIT (type));
if (size == 1 || size == 2 || size == 4 || size == 8 || size == 16)
return size;
@@ -10309,7 +10309,7 @@ get_atomic_generic_size (location_t loc, tree function,
return 0;
}
- size_0 = tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (type_0)), 1);
+ size_0 = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (type_0)));
/* Zero size objects are not allowed. */
if (size_0 == 0)
@@ -10334,7 +10334,7 @@ get_atomic_generic_size (location_t loc, tree function,
function);
return 0;
}
- size = tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (type)), 1);
+ size = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (type)));
if (size != size_0)
{
error_at (loc, "size mismatch in argument %d of %qE", x + 1,
@@ -10349,7 +10349,7 @@ get_atomic_generic_size (location_t loc, tree function,
tree p = (*params)[x];
if (TREE_CODE (p) == INTEGER_CST)
{
- int i = tree_low_cst (p, 1);
+ int i = tree_to_uhwi (p);
if (i < 0 || (i & MEMMODEL_MASK) >= MEMMODEL_LAST)
{
warning_at (loc, OPT_Winvalid_memory_model,
@@ -11703,7 +11703,7 @@ convert_vector_to_pointer_for_subscript (location_t loc,
if (TREE_CODE (index) == INTEGER_CST)
if (!tree_fits_uhwi_p (index)
- || ((unsigned HOST_WIDE_INT) tree_low_cst (index, 1)
+ || ((unsigned HOST_WIDE_INT) tree_to_uhwi (index)
>= TYPE_VECTOR_SUBPARTS (type)))
warning_at (loc, OPT_Warray_bounds, "index value is out of bound");
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index b9a0f18cd7e..c5e895c5850 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -106,7 +106,7 @@ static void
builtin_define_type_sizeof (const char *name, tree type)
{
builtin_define_with_int_value (name,
- tree_low_cst (TYPE_SIZE_UNIT (type), 1));
+ tree_to_uhwi (TYPE_SIZE_UNIT (type)));
}
/* Define the float.h constants for TYPE using NAME_PREFIX, FP_SUFFIX,
@@ -648,7 +648,7 @@ cpp_atomic_builtins (cpp_reader *pfile)
/* Tell the source code about various types. These map to the C++11 and C11
macros where 2 indicates lock-free always, and 1 indicates sometimes
lock free. */
-#define SIZEOF_NODE(T) (tree_low_cst (TYPE_SIZE_UNIT (T), 1))
+#define SIZEOF_NODE(T) (tree_to_uhwi (TYPE_SIZE_UNIT (T)))
#define SWAP_INDEX(T) ((SIZEOF_NODE (T) < SWAP_LIMIT) ? SIZEOF_NODE (T) : 0)
builtin_define_with_int_value ("__GCC_ATOMIC_BOOL_LOCK_FREE",
(have_swap[SWAP_INDEX (boolean_type_node)]? 2 : 1));
OpenPOWER on IntegriCloud