summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
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/stor-layout.c
parentfcb97e84adcb5693684d9cfa7b2a97af32ba7a45 (diff)
downloadgcc-6a0712d4ee92fb8ddf409de894393962bb54cbbf.tar.gz
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/stor-layout.c')
-rw-r--r--gcc/stor-layout.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 48c6c783a14..659bfbb5566 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -334,7 +334,7 @@ mode_for_size_tree (const_tree size, enum mode_class mclass, int limit)
if (!tree_fits_uhwi_p (size))
return BLKmode;
- uhwi = tree_low_cst (size, 1);
+ uhwi = tree_to_uhwi (size);
ui = uhwi;
if (uhwi != ui)
return BLKmode;
@@ -485,8 +485,8 @@ mode_for_array (tree elem_type, tree size)
limit_p = true;
if (tree_fits_uhwi_p (size) && tree_fits_uhwi_p (elem_size))
{
- int_size = tree_low_cst (size, 1);
- int_elem_size = tree_low_cst (elem_size, 1);
+ int_size = tree_to_uhwi (size);
+ int_elem_size = tree_to_uhwi (elem_size);
if (int_elem_size > 0
&& int_size % int_elem_size == 0
&& targetm.array_mode_supported_p (TYPE_MODE (elem_type),
@@ -1053,7 +1053,7 @@ excess_unit_span (HOST_WIDE_INT byte_offset, HOST_WIDE_INT bit_offset,
offset = offset % align;
return ((offset + size + align - 1) / align
- > ((unsigned HOST_WIDE_INT) tree_low_cst (TYPE_SIZE (type), 1)
+ > ((unsigned HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
/ align));
}
#endif
@@ -1113,14 +1113,14 @@ place_field (record_layout_info rli, tree field)
/* Work out the known alignment so far. Note that A & (-A) is the
value of the least-significant bit in A that is one. */
if (! integer_zerop (rli->bitpos))
- known_align = (tree_low_cst (rli->bitpos, 1)
- & - tree_low_cst (rli->bitpos, 1));
+ known_align = (tree_to_uhwi (rli->bitpos)
+ & - tree_to_uhwi (rli->bitpos));
else if (integer_zerop (rli->offset))
known_align = 0;
else if (tree_fits_uhwi_p (rli->offset))
known_align = (BITS_PER_UNIT
- * (tree_low_cst (rli->offset, 1)
- & - tree_low_cst (rli->offset, 1)));
+ * (tree_to_uhwi (rli->offset)
+ & - tree_to_uhwi (rli->offset)));
else
known_align = rli->offset_align;
@@ -1200,7 +1200,7 @@ place_field (record_layout_info rli, tree field)
{
unsigned int type_align = TYPE_ALIGN (type);
tree dsize = DECL_SIZE (field);
- HOST_WIDE_INT field_size = tree_low_cst (dsize, 1);
+ HOST_WIDE_INT field_size = tree_to_uhwi (dsize);
HOST_WIDE_INT offset = tree_to_shwi (rli->offset);
HOST_WIDE_INT bit_offset = tree_to_shwi (rli->bitpos);
@@ -1244,7 +1244,7 @@ place_field (record_layout_info rli, tree field)
{
unsigned int type_align = TYPE_ALIGN (type);
tree dsize = DECL_SIZE (field);
- HOST_WIDE_INT field_size = tree_low_cst (dsize, 1);
+ HOST_WIDE_INT field_size = tree_to_uhwi (dsize);
HOST_WIDE_INT offset = tree_to_shwi (rli->offset);
HOST_WIDE_INT bit_offset = tree_to_shwi (rli->bitpos);
@@ -1307,11 +1307,11 @@ place_field (record_layout_info rli, tree field)
/* We're in the middle of a run of equal type size fields; make
sure we realign if we run out of bits. (Not decl size,
type size!) */
- HOST_WIDE_INT bitsize = tree_low_cst (DECL_SIZE (field), 1);
+ HOST_WIDE_INT bitsize = tree_to_uhwi (DECL_SIZE (field));
if (rli->remaining_in_alignment < bitsize)
{
- HOST_WIDE_INT typesize = tree_low_cst (TYPE_SIZE (type), 1);
+ HOST_WIDE_INT typesize = tree_to_uhwi (TYPE_SIZE (type));
/* out of bits; bump up to next 'word'. */
rli->bitpos
@@ -1387,9 +1387,9 @@ place_field (record_layout_info rli, tree field)
&& tree_fits_uhwi_p (DECL_SIZE (field)))
{
unsigned HOST_WIDE_INT bitsize
- = tree_low_cst (DECL_SIZE (field), 1);
+ = tree_to_uhwi (DECL_SIZE (field));
unsigned HOST_WIDE_INT typesize
- = tree_low_cst (TYPE_SIZE (TREE_TYPE (field)), 1);
+ = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (field)));
if (typesize < bitsize)
rli->remaining_in_alignment = 0;
@@ -1421,14 +1421,14 @@ place_field (record_layout_info rli, tree field)
approximate this by seeing if its position changed), lay out the field
again; perhaps we can use an integral mode for it now. */
if (! integer_zerop (DECL_FIELD_BIT_OFFSET (field)))
- actual_align = (tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)
- & - tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1));
+ actual_align = (tree_to_uhwi (DECL_FIELD_BIT_OFFSET (field))
+ & - tree_to_uhwi (DECL_FIELD_BIT_OFFSET (field)));
else if (integer_zerop (DECL_FIELD_OFFSET (field)))
actual_align = MAX (BIGGEST_ALIGNMENT, rli->record_align);
else if (tree_fits_uhwi_p (DECL_FIELD_OFFSET (field)))
actual_align = (BITS_PER_UNIT
- * (tree_low_cst (DECL_FIELD_OFFSET (field), 1)
- & - tree_low_cst (DECL_FIELD_OFFSET (field), 1)));
+ * (tree_to_uhwi (DECL_FIELD_OFFSET (field))
+ & - tree_to_uhwi (DECL_FIELD_OFFSET (field))));
else
actual_align = DECL_OFFSET_ALIGN (field);
/* ACTUAL_ALIGN is still the actual alignment *within the record* .
@@ -1764,10 +1764,10 @@ finish_bitfield_representative (tree repr, tree field)
size = size_diffop (DECL_FIELD_OFFSET (field),
DECL_FIELD_OFFSET (repr));
gcc_assert (tree_fits_uhwi_p (size));
- bitsize = (tree_low_cst (size, 1) * BITS_PER_UNIT
- + tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)
- - tree_low_cst (DECL_FIELD_BIT_OFFSET (repr), 1)
- + tree_low_cst (DECL_SIZE (field), 1));
+ bitsize = (tree_to_uhwi (size) * BITS_PER_UNIT
+ + tree_to_uhwi (DECL_FIELD_BIT_OFFSET (field))
+ - tree_to_uhwi (DECL_FIELD_BIT_OFFSET (repr))
+ + tree_to_uhwi (DECL_SIZE (field)));
/* Round up bitsize to multiples of BITS_PER_UNIT. */
bitsize = (bitsize + BITS_PER_UNIT - 1) & ~(BITS_PER_UNIT - 1);
@@ -1787,9 +1787,9 @@ finish_bitfield_representative (tree repr, tree field)
DECL_FIELD_OFFSET (repr));
if (tree_fits_uhwi_p (maxsize))
{
- maxbitsize = (tree_low_cst (maxsize, 1) * BITS_PER_UNIT
- + tree_low_cst (DECL_FIELD_BIT_OFFSET (nextf), 1)
- - tree_low_cst (DECL_FIELD_BIT_OFFSET (repr), 1));
+ maxbitsize = (tree_to_uhwi (maxsize) * BITS_PER_UNIT
+ + tree_to_uhwi (DECL_FIELD_BIT_OFFSET (nextf))
+ - tree_to_uhwi (DECL_FIELD_BIT_OFFSET (repr)));
/* If the group ends within a bitfield nextf does not need to be
aligned to BITS_PER_UNIT. Thus round up. */
maxbitsize = (maxbitsize + BITS_PER_UNIT - 1) & ~(BITS_PER_UNIT - 1);
@@ -1807,8 +1807,8 @@ finish_bitfield_representative (tree repr, tree field)
tree maxsize = size_diffop (TYPE_SIZE_UNIT (DECL_CONTEXT (field)),
DECL_FIELD_OFFSET (repr));
if (tree_fits_uhwi_p (maxsize))
- maxbitsize = (tree_low_cst (maxsize, 1) * BITS_PER_UNIT
- - tree_low_cst (DECL_FIELD_BIT_OFFSET (repr), 1));
+ maxbitsize = (tree_to_uhwi (maxsize) * BITS_PER_UNIT
+ - tree_to_uhwi (DECL_FIELD_BIT_OFFSET (repr)));
else
maxbitsize = bitsize;
}