Commit c10bc6e9 by Roger Sayle Committed by Roger Sayle

dependency.c (gfc_is_same_range): Compare the stride...


	* dependency.c (gfc_is_same_range): Compare the stride, lower and
	upper bounds when testing array reference ranges for equality.

	(gfc_check_dependency): Fix indentation whitespace.
	(gfc_check_element_vs_element): Likewise.
	(gfc_dep_resolver): Likewise.

From-SVN: r111601
parent 6578c101
2006-03-01 Roger Sayle <roger@eyesopen.com>
* dependency.c (gfc_is_same_range): Compare the stride, lower and
upper bounds when testing array reference ranges for equality.
(gfc_check_dependency): Fix indentation whitespace.
(gfc_check_element_vs_element): Likewise.
(gfc_dep_resolver): Likewise.
2006-02-28 Thomas Koenig <Thomas.Koenig@online.de>
* trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc):
......
......@@ -150,10 +150,8 @@ gfc_is_same_range (gfc_array_ref * ar1, gfc_array_ref * ar2, int n, int def)
/* Check the range start. */
e1 = ar1->start[n];
e2 = ar2->start[n];
if (!(e1 || e2))
return 1;
if (e1 || e2)
{
/* Use the bound of the array if no bound is specified. */
if (ar1->as && !e1)
e1 = ar1->as->lower[n];
......@@ -166,12 +164,36 @@ gfc_is_same_range (gfc_array_ref * ar1, gfc_array_ref * ar2, int n, int def)
return def;
i = gfc_dep_compare_expr (e1, e2);
if (i == -2)
return def;
else if (i != 0)
return 0;
}
/* Check the range end. */
e1 = ar1->end[n];
e2 = ar2->end[n];
if (e1 || e2)
{
/* Use the bound of the array if no bound is specified. */
if (ar1->as && !e1)
e1 = ar1->as->upper[n];
if (ar2->as && !e2)
e2 = ar2->as->upper[n];
/* Check we have values for both. */
if (!(e1 && e2))
return def;
i = gfc_dep_compare_expr (e1, e2);
if (i == -2)
return def;
else if (i == 0)
return 1;
else if (i != 0)
return 0;
}
return 1;
}
......
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