Commit 278f422c by Eric Botcazou

trans.c (Loop_Statement_to_gnu): Use IN_RANGE macro.

	* gcc-interface/trans.c (Loop_Statement_to_gnu): Use IN_RANGE macro.
	* gcc-interface/misc.c (gnat_get_array_descr_info): Likewise.
	(default_pass_by_ref): Likewise.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.

From-SVN: r255854
parent 378056b2
2017-12-20 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Loop_Statement_to_gnu): Use IN_RANGE macro.
* gcc-interface/misc.c (gnat_get_array_descr_info): Likewise.
(default_pass_by_ref): Likewise.
* gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
2017-12-19 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/trans.c (Loop_Statement_to_gnu): Replace Yoda
conditions with typical order conditions.
* gcc-interface/misc.c (gnat_get_array_descr_info,
default_pass_by_ref): Likewise.
* gcc-interface/misc.c (gnat_get_array_descr_info): Likewise.
(default_pass_by_ref): Likewise.
* gcc-interface/decl.c (gnat_to_gnu_entity): Likewise.
* adaint.c (__gnat_tmp_name): Likewise.
......
......@@ -2111,7 +2111,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
index to the template. */
for (index = (convention_fortran_p ? ndim - 1 : 0),
gnat_index = First_Index (gnat_entity);
index >= 0 && index < ndim;
IN_RANGE (index, 0, ndim - 1);
index += (convention_fortran_p ? - 1 : 1),
gnat_index = Next_Index (gnat_index))
{
......@@ -2362,7 +2362,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
gnat_index = First_Index (gnat_entity),
gnat_base_index
= First_Index (Implementation_Base_Type (gnat_entity));
index >= 0 && index < ndim;
IN_RANGE (index, 0, ndim - 1);
index += (convention_fortran_p ? - 1 : 1),
gnat_index = Next_Index (gnat_index),
gnat_base_index = Next_Index (gnat_base_index))
......
......@@ -953,7 +953,7 @@ gnat_get_array_descr_info (const_tree const_type,
structure. */
for (i = (convention_fortran_p ? info->ndimensions - 1 : 0),
dimen = first_dimen;
i >= 0 && i < info->ndimensions;
IN_RANGE (i, 0, info->ndimensions - 1);
i += (convention_fortran_p ? -1 : 1),
dimen = TREE_TYPE (dimen))
{
......
......@@ -3190,8 +3190,9 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
/* Note that loop unswitching can only be applied a small number of
times to a given loop (PARAM_MAX_UNSWITCH_LEVEL default to 3). */
if (n_remaining_checks > 0 && n_remaining_checks <= 3
&& optimize > 1 && !optimize_size)
if (IN_RANGE (n_remaining_checks, 1, 3)
&& optimize > 1
&& !optimize_size)
FOR_EACH_VEC_ELT (*gnu_loop_info->checks, i, rci)
if (rci->invariant_cond != boolean_false_node)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment