[PATCH] committed to remove spurious return.

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Jun 5 19:53:00 GMT 2006


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



More information about the Gcc-patches mailing list