This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] committed to remove spurious return.
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Jun 2006 12:53:10 -0700
- Subject: [PATCH] committed to remove spurious return.
gfortran supports the extension of re-initializing a variable
in a data statement, but a spurious return actually prevented
the intended behavior.
Consider,
integer :: x = 1
data x/2/
print *, x
end
gfortran would produce an a.out that prints 1 instead of 2.
With the patch, we now get 2.
2006-06-05 Steven G. Kargl <kargls@comcast.net>
* data.c (gfc_assign_data_value): Fix comment typo. Remove
a spurious return.
Index: data.c
===================================================================
--- data.c (revision 114402)
+++ data.c (working copy)
@@ -231,7 +231,7 @@ gfc_assign_data_value (gfc_expr * lvalue
/* Break out of the loop if we find a substring. */
if (ref->type == REF_SUBSTRING)
{
- /* A substring should always br the last subobject reference. */
+ /* A substring should always be the last subobject reference. */
gcc_assert (ref->next == NULL);
break;
}
@@ -340,7 +340,6 @@ gfc_assign_data_value (gfc_expr * lvalue
#endif
gfc_notify_std (GFC_STD_GNU, "Extension: re-initialization "
"of '%s' at %L", symbol->name, &expr->where);
- return;
}
expr = gfc_copy_expr (rvalue);
--
Steve