https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124257
--- Comment #1 from anlauf at gcc dot gnu.org ---
After looking at the surrounding code, I think the warning is sort of
misleading:
for (dim = GFC_TYPE_ARRAY_RANK (type);
dim < GFC_TYPE_ARRAY_RANK (type) + GFC_TYPE_ARRAY_CORANK (type); dim++)
{
if (GFC_TYPE_ARRAY_LBOUND (type, dim) == NULL_TREE)
{
GFC_TYPE_ARRAY_LBOUND (type, dim) = create_index_var ("lbound",
nest);
suppress_warning (GFC_TYPE_ARRAY_LBOUND (type, dim));
}
/* Don't try to use the unknown ubound for the last coarray dimension.
*/
if (GFC_TYPE_ARRAY_UBOUND (type, dim) == NULL_TREE
&& dim < GFC_TYPE_ARRAY_RANK (type) + GFC_TYPE_ARRAY_CORANK (type) -
1)
{
GFC_TYPE_ARRAY_UBOUND (type, dim) = create_index_var ("ubound",
nest);
suppress_warning (GFC_TYPE_ARRAY_UBOUND (type, dim));
}
}
Reordering the expression makes the code less readable and does not fix
an actual problem.