* hsa-gen.c (hsa_op_immed::hsa_op_immed Use CONSTRUCTOR_NELTS (...)

instead of vec_safe_length (CONSTRUCTOR_ELTS (...)).
	(gen_hsa_ctor_assignment): Likewise.
	* print-tree.c (print_node): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-sra.c (sra_modify_constructor_assign): Likewise.
	* expr.c (store_constructor): Likewise.
	* fold-const.c (operand_equal_p): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* hsa-brig.c (hsa_op_immed::emit_to_buffer): Likewise.
	* ipa-icf-gimple.c (func_checker::compare_operand): Likewise.
cp/
	* typeck2.c (process_init_constructor_record): Use
	CONSTRUCTOR_NELTS (...) instead of
	vec_safe_length (CONSTRUCTOR_ELTS (...)).
	* decl.c (reshape_init_r): Likewise.
	(check_initializer): Likewise.
ada/
	* gcc-interface/decl.c (gnat_to_gnu_entity): Use
	CONSTRUCTOR_NELTS (...) instead of
	vec_safe_length (CONSTRUCTOR_ELTS (...)).

From-SVN: r240390
This commit is contained in:
Jakub Jelinek 2016-09-23 09:34:43 +02:00 committed by Jakub Jelinek
parent 9500733cc6
commit aaa1b10f54
15 changed files with 44 additions and 19 deletions

View file

@ -1,3 +1,17 @@
2016-09-23 Jakub Jelinek <jakub@redhat.com>
* hsa-gen.c (hsa_op_immed::hsa_op_immed Use CONSTRUCTOR_NELTS (...)
instead of vec_safe_length (CONSTRUCTOR_ELTS (...)).
(gen_hsa_ctor_assignment): Likewise.
* print-tree.c (print_node): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
* tree-sra.c (sra_modify_constructor_assign): Likewise.
* expr.c (store_constructor): Likewise.
* fold-const.c (operand_equal_p): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
* hsa-brig.c (hsa_op_immed::emit_to_buffer): Likewise.
* ipa-icf-gimple.c (func_checker::compare_operand): Likewise.
2016-09-23 Richard Biener <rguenther@suse.de>
* hooks.h (hook_uint_uintp_false): Declare.

View file

@ -1,3 +1,9 @@
2016-09-23 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Use
CONSTRUCTOR_NELTS (...) instead of
vec_safe_length (CONSTRUCTOR_ELTS (...)).
2016-07-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Access_Type>: Also use

View file

@ -1339,7 +1339,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
= TREE_TYPE (DECL_CHAIN (TYPE_FIELDS (gnu_alloc_type)));
if (TREE_CODE (gnu_expr) == CONSTRUCTOR
&& vec_safe_length (CONSTRUCTOR_ELTS (gnu_expr)) == 1)
&& CONSTRUCTOR_NELTS (gnu_expr) == 1)
gnu_expr = NULL_TREE;
else
gnu_expr

View file

@ -1,3 +1,11 @@
2016-09-23 Jakub Jelinek <jakub@redhat.com>
* typeck2.c (process_init_constructor_record): Use
CONSTRUCTOR_NELTS (...) instead of
vec_safe_length (CONSTRUCTOR_ELTS (...)).
* decl.c (reshape_init_r): Likewise.
(check_initializer): Likewise.
2016-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71979

View file

@ -5933,7 +5933,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
element (as allowed by [dcl.init.string]). */
if (!first_initializer_p
&& TREE_CODE (str_init) == CONSTRUCTOR
&& vec_safe_length (CONSTRUCTOR_ELTS (str_init)) == 1)
&& CONSTRUCTOR_NELTS (str_init) == 1)
{
str_init = (*CONSTRUCTOR_ELTS (str_init))[0].value;
}
@ -6136,7 +6136,7 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
if (init && BRACE_ENCLOSED_INITIALIZER_P (init))
{
int init_len = vec_safe_length (CONSTRUCTOR_ELTS (init));
int init_len = CONSTRUCTOR_NELTS (init);
if (SCALAR_TYPE_P (type))
{
if (init_len == 0)

View file

@ -1379,7 +1379,7 @@ process_init_constructor_record (tree type, tree init,
if (type == error_mark_node)
return PICFLAG_ERRONEOUS;
if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init)))
if (idx < CONSTRUCTOR_NELTS (init))
{
constructor_elt *ce = &(*CONSTRUCTOR_ELTS (init))[idx];
if (ce->index)
@ -1476,7 +1476,7 @@ process_init_constructor_record (tree type, tree init,
CONSTRUCTOR_APPEND_ELT (v, field, next);
}
if (idx < vec_safe_length (CONSTRUCTOR_ELTS (init)))
if (idx < CONSTRUCTOR_NELTS (init))
{
if (complain & tf_error)
error ("too many initializers for %qT", type);

View file

@ -6187,8 +6187,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size,
register whose mode size isn't equal to SIZE since
clear_storage can't handle this case. */
else if (size > 0
&& (((int)vec_safe_length (CONSTRUCTOR_ELTS (exp))
!= fields_length (type))
&& (((int) CONSTRUCTOR_NELTS (exp) != fields_length (type))
|| mostly_zeros_p (exp))
&& (!REG_P (target)
|| ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target))

View file

@ -2954,8 +2954,7 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
case CONSTRUCTOR:
/* In GIMPLE empty constructors are allowed in initializers of
aggregates. */
return (!vec_safe_length (CONSTRUCTOR_ELTS (arg0))
&& !vec_safe_length (CONSTRUCTOR_ELTS (arg1)));
return !CONSTRUCTOR_NELTS (arg0) && !CONSTRUCTOR_NELTS (arg1);
default:
break;
}

View file

@ -985,7 +985,7 @@ hsa_op_immed::emit_to_buffer (unsigned *brig_repr_size)
}
else if (TREE_CODE (m_tree_value) == CONSTRUCTOR)
{
unsigned len = vec_safe_length (CONSTRUCTOR_ELTS (m_tree_value));
unsigned len = CONSTRUCTOR_NELTS (m_tree_value);
for (unsigned i = 0; i < len; i++)
{
tree v = CONSTRUCTOR_ELT (m_tree_value, i)->value;

View file

@ -1100,8 +1100,7 @@ hsa_op_immed::hsa_op_immed (tree tree_val, bool min32int)
/* Verify that all elements of a constructor are constants. */
if (TREE_CODE (m_tree_value) == CONSTRUCTOR)
for (unsigned i = 0;
i < vec_safe_length (CONSTRUCTOR_ELTS (m_tree_value)); i++)
for (unsigned i = 0; i < CONSTRUCTOR_NELTS (m_tree_value); i++)
{
tree v = CONSTRUCTOR_ELT (m_tree_value, i)->value;
if (!CONSTANT_CLASS_P (v))
@ -2845,7 +2844,7 @@ void
gen_hsa_ctor_assignment (hsa_op_address *addr_lhs, tree rhs, hsa_bb *hbb,
BrigAlignment8_t align)
{
if (vec_safe_length (CONSTRUCTOR_ELTS (rhs)))
if (CONSTRUCTOR_NELTS (rhs))
{
HSA_SORRY_AT (EXPR_LOCATION (rhs),
"support for HSA does not implement load from constructor");

View file

@ -406,8 +406,8 @@ func_checker::compare_operand (tree t1, tree t2)
{
case CONSTRUCTOR:
{
unsigned length1 = vec_safe_length (CONSTRUCTOR_ELTS (t1));
unsigned length2 = vec_safe_length (CONSTRUCTOR_ELTS (t2));
unsigned length1 = CONSTRUCTOR_NELTS (t1);
unsigned length2 = CONSTRUCTOR_NELTS (t2);
if (length1 != length2)
return return_false ();

View file

@ -841,7 +841,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
{
unsigned HOST_WIDE_INT cnt;
tree index, value;
len = vec_safe_length (CONSTRUCTOR_ELTS (node));
len = CONSTRUCTOR_NELTS (node);
fprintf (file, " lngt %d", len);
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node),
cnt, index, value)

View file

@ -646,7 +646,7 @@ dequeue_and_dump (dump_info_p di)
{
unsigned HOST_WIDE_INT cnt;
tree index, value;
dump_int (di, "lngt", vec_safe_length (CONSTRUCTOR_ELTS (t)));
dump_int (di, "lngt", CONSTRUCTOR_NELTS (t));
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (t), cnt, index, value)
{
dump_child ("idx", index);

View file

@ -1983,7 +1983,7 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, int flags,
dump_decl_name (pp, val, flags);
else
dump_generic_node (pp, val, spc, flags, false);
if (ix != vec_safe_length (CONSTRUCTOR_ELTS (node)) - 1)
if (ix != CONSTRUCTOR_NELTS (node) - 1)
{
pp_comma (pp);
pp_space (pp);

View file

@ -3224,7 +3224,7 @@ sra_modify_constructor_assign (gimple *stmt, gimple_stmt_iterator *gsi)
return SRA_AM_MODIFIED;
}
if (vec_safe_length (CONSTRUCTOR_ELTS (gimple_assign_rhs1 (stmt))) > 0)
if (CONSTRUCTOR_NELTS (gimple_assign_rhs1 (stmt)) > 0)
{
/* I have never seen this code path trigger but if it can happen the
following should handle it gracefully. */