Commit 01306727 by Francois-Xavier Coudert Committed by François-Xavier Coudert

re PR fortran/29459 (Spurious warnings about anonymous variables)

	PR fortran/29459
	* trans-array.c (gfc_trans_array_constructor): Mark offset field
	with TREE_NO_WARNING.
	* trans-decl.c (gfc_build_qualified_array): Mark lbound, ubound,
	stride and size variables with TREE_NO_WARNING.

From-SVN: r126496
parent 0f67fa83
2007-07-09 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/29459
* trans-array.c (gfc_trans_array_constructor): Mark offset field
with TREE_NO_WARNING.
* trans-decl.c (gfc_build_qualified_array): Mark lbound, ubound,
stride and size variables with TREE_NO_WARNING.
2007-07-09 Steven G. Kargl <kargl@gcc.gnu.org> 2007-07-09 Steven G. Kargl <kargl@gcc.gnu.org>
* trans-decl.c (set_tree_decl_type_code): Remove function. * trans-decl.c (set_tree_decl_type_code): Remove function.
......
...@@ -1695,6 +1695,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss) ...@@ -1695,6 +1695,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss)
desc = ss->data.info.descriptor; desc = ss->data.info.descriptor;
offset = gfc_index_zero_node; offset = gfc_index_zero_node;
offsetvar = gfc_create_var_np (gfc_array_index_type, "offset"); offsetvar = gfc_create_var_np (gfc_array_index_type, "offset");
TREE_NO_WARNING (offsetvar) = 1;
TREE_USED (offsetvar) = 0; TREE_USED (offsetvar) = 0;
gfc_trans_array_constructor_value (&loop->pre, type, desc, c, gfc_trans_array_constructor_value (&loop->pre, type, desc, c,
&offset, &offsetvar, dynamic); &offset, &offsetvar, dynamic);
......
...@@ -633,20 +633,31 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) ...@@ -633,20 +633,31 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
for (dim = 0; dim < GFC_TYPE_ARRAY_RANK (type); dim++) for (dim = 0; dim < GFC_TYPE_ARRAY_RANK (type); dim++)
{ {
if (GFC_TYPE_ARRAY_LBOUND (type, dim) == NULL_TREE) if (GFC_TYPE_ARRAY_LBOUND (type, dim) == NULL_TREE)
GFC_TYPE_ARRAY_LBOUND (type, dim) = create_index_var ("lbound", nest); {
GFC_TYPE_ARRAY_LBOUND (type, dim) = create_index_var ("lbound", nest);
TREE_NO_WARNING (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 1;
}
/* Don't try to use the unknown bound for assumed shape arrays. */ /* Don't try to use the unknown bound for assumed shape arrays. */
if (GFC_TYPE_ARRAY_UBOUND (type, dim) == NULL_TREE if (GFC_TYPE_ARRAY_UBOUND (type, dim) == NULL_TREE
&& (sym->as->type != AS_ASSUMED_SIZE && (sym->as->type != AS_ASSUMED_SIZE
|| dim < GFC_TYPE_ARRAY_RANK (type) - 1)) || dim < GFC_TYPE_ARRAY_RANK (type) - 1))
GFC_TYPE_ARRAY_UBOUND (type, dim) = create_index_var ("ubound", nest); {
GFC_TYPE_ARRAY_UBOUND (type, dim) = create_index_var ("ubound", nest);
TREE_NO_WARNING (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 1;
}
if (GFC_TYPE_ARRAY_STRIDE (type, dim) == NULL_TREE) if (GFC_TYPE_ARRAY_STRIDE (type, dim) == NULL_TREE)
GFC_TYPE_ARRAY_STRIDE (type, dim) = create_index_var ("stride", nest); {
GFC_TYPE_ARRAY_STRIDE (type, dim) = create_index_var ("stride", nest);
TREE_NO_WARNING (GFC_TYPE_ARRAY_STRIDE (type, dim)) = 1;
}
} }
if (GFC_TYPE_ARRAY_OFFSET (type) == NULL_TREE) if (GFC_TYPE_ARRAY_OFFSET (type) == NULL_TREE)
{ {
GFC_TYPE_ARRAY_OFFSET (type) = gfc_create_var_np (gfc_array_index_type, GFC_TYPE_ARRAY_OFFSET (type) = gfc_create_var_np (gfc_array_index_type,
"offset"); "offset");
TREE_NO_WARNING (GFC_TYPE_ARRAY_OFFSET (type)) = 1;
if (nest) if (nest)
gfc_add_decl_to_parent_function (GFC_TYPE_ARRAY_OFFSET (type)); gfc_add_decl_to_parent_function (GFC_TYPE_ARRAY_OFFSET (type));
else else
...@@ -655,7 +666,10 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym) ...@@ -655,7 +666,10 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
if (GFC_TYPE_ARRAY_SIZE (type) == NULL_TREE if (GFC_TYPE_ARRAY_SIZE (type) == NULL_TREE
&& sym->as->type != AS_ASSUMED_SIZE) && sym->as->type != AS_ASSUMED_SIZE)
GFC_TYPE_ARRAY_SIZE (type) = create_index_var ("size", nest); {
GFC_TYPE_ARRAY_SIZE (type) = create_index_var ("size", nest);
TREE_NO_WARNING (GFC_TYPE_ARRAY_SIZE (type)) = 1;
}
if (POINTER_TYPE_P (type)) if (POINTER_TYPE_P (type))
{ {
......
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