aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2006-11-12 02:57:10 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2006-11-12 02:57:10 +0000
commit000d8d44b711707b56c75f2d1ebfa6ca046ec7ae (patch)
tree58a441d6fe7ffeccb38541fe24123167cc9fb14f /gcc/stor-layout.c
parentafa8f0fb33f62b3e9ea2fad0813372730d18295b (diff)
downloadgcc-000d8d44b711707b56c75f2d1ebfa6ca046ec7ae.zip
gcc-000d8d44b711707b56c75f2d1ebfa6ca046ec7ae.tar.gz
gcc-000d8d44b711707b56c75f2d1ebfa6ca046ec7ae.tar.bz2
fold-const.c (int_binop_types_match_p): New function.
* fold-const.c (int_binop_types_match_p): New function. (size_binop): Relax constraint that both arguments must both have exactly the same sizetype type. Instead use int_binop_types_match_p. (size_diffop): Likewise. (make_range): Use build_int_cst instead of fold_convert. (fold_cond_expr_with_comparison): Use build_int_cst to construct integer constants of the correct type. (fold_div_compare): Likewise. (fold_single_bit_test): Likewise. (fold_binary): Likewise. * stor-layout.c (layout_type) <VECTOR_TYPE>: Ensure that TYPE_SIZE has type bitsizetype and TYPE_SIZE_UNIT has type sizetype. From-SVN: r118718
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 51db310..ccbf9f7 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1617,7 +1617,6 @@ layout_type (tree type)
case VECTOR_TYPE:
{
int nunits = TYPE_VECTOR_SUBPARTS (type);
- tree nunits_tree = build_int_cst (NULL_TREE, nunits);
tree innertype = TREE_TYPE (type);
gcc_assert (!(nunits & (nunits - 1)));
@@ -1655,9 +1654,9 @@ layout_type (tree type)
TYPE_UNSIGNED (type) = TYPE_UNSIGNED (TREE_TYPE (type));
TYPE_SIZE_UNIT (type) = int_const_binop (MULT_EXPR,
TYPE_SIZE_UNIT (innertype),
- nunits_tree, 0);
+ size_int (nunits), 0);
TYPE_SIZE (type) = int_const_binop (MULT_EXPR, TYPE_SIZE (innertype),
- nunits_tree, 0);
+ bitsize_int (nunits), 0);
/* Always naturally align vectors. This prevents ABI changes
depending on whether or not native vector modes are supported. */