summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/misc.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-28 10:51:19 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-28 10:51:19 +0000
commit97658fc97709841bfbdbb9acb2c38a0535b7ba1f (patch)
tree66a07373943672c9d9ef3f8e395acb3f21fe89cd /gcc/ada/gcc-interface/misc.c
parent004805e2af84281eb0f8606f83b271df19a44193 (diff)
* stor-layout.c (layout_type) <ARRAY_TYPE>: Do not clear TREE_OVERFLOW
on overflowed zeroes, except in one specific case. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Use valid_constant_size_p to detect too large objects. <E_Subprogram_Type>: Likewise for too large return types. (allocatable_size_p): Call valid_constant_size_p in the fixed case. (annotate_value) <INTEGER_CST>: Simplify. <BIT_AND_EXPR>: Deal with negative values here. * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use valid_constant_size_p to detect too large objects on the LHS. * gcc-interface/misc.c (default_pass_by_ref): Likewise for large types. And use TYPE_SIZE_UNIT throughout. (must_pass_by_ref): Likewise. * gcc-interface/utils.c (max_size) <tcc_unary>: Split from common case. <tcc_binary>: Likewise. Call size_binop instead of fold_build2. <tcc_expression>: Simplify. * gcc-interface/utils2.c (build_allocator): Use valid_constant_size_p to detect too large allocations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193886 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/misc.c')
-rw-r--r--gcc/ada/gcc-interface/misc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index baa44c95be7d..3d3f16110ce0 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -604,8 +604,8 @@ gnat_get_subrange_bounds (const_tree gnu_type, tree *lowval, tree *highval)
bool
default_pass_by_ref (tree gnu_type)
{
- /* We pass aggregates by reference if they are sufficiently large. The
- choice of constant here is somewhat arbitrary. We also pass by
+ /* We pass aggregates by reference if they are sufficiently large for
+ their alignment. The ratio is somewhat arbitrary. We also pass by
reference if the target machine would either pass or return by
reference. Strictly speaking, we need only check the return if this
is an In Out parameter, but it's probably best to err on the side of
@@ -618,9 +618,9 @@ default_pass_by_ref (tree gnu_type)
return true;
if (AGGREGATE_TYPE_P (gnu_type)
- && (!host_integerp (TYPE_SIZE (gnu_type), 1)
- || 0 < compare_tree_int (TYPE_SIZE (gnu_type),
- 8 * TYPE_ALIGN (gnu_type))))
+ && (!valid_constant_size_p (TYPE_SIZE_UNIT (gnu_type))
+ || 0 < compare_tree_int (TYPE_SIZE_UNIT (gnu_type),
+ TYPE_ALIGN (gnu_type))))
return true;
return false;
@@ -639,8 +639,8 @@ must_pass_by_ref (tree gnu_type)
not have such objects. */
return (TREE_CODE (gnu_type) == UNCONSTRAINED_ARRAY_TYPE
|| TYPE_IS_BY_REFERENCE_P (gnu_type)
- || (TYPE_SIZE (gnu_type)
- && TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST));
+ || (TYPE_SIZE_UNIT (gnu_type)
+ && TREE_CODE (TYPE_SIZE_UNIT (gnu_type)) != INTEGER_CST));
}
/* This function is called by the front-end to enumerate all the supported