* match.c (gfc_match_return): Only require space after keyword when
it is obligatory. Only give stdwarn to after matching is successful.
* dump-parse-tree.c (gfc_show_symbol): Deal with alternate returns.
testsuite/
* gfortran.dg/return_1.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99467
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-05-09 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * match.c (gfc_match_return): Only require space after keyword when
+ it is obligatory. Only give stdwarn to after matching is successful.
+ * dump-parse-tree.c (gfc_show_symbol): Deal with alternate returns.
+
2005-05-08 Kazu Hirata <kazu@cs.umass.edu>
* intrinsic.texi: Fix typos.
gfc_status ("Formal arglist:");
for (formal = sym->formal; formal; formal = formal->next)
- gfc_status (" %s", formal->sym->name);
+ {
+ if (formal->sym != NULL)
+ gfc_status (" %s", formal->sym->name);
+ else
+ gfc_status (" [Alt Return]");
+ }
}
if (sym->formal_ns)
gfc_expr *e;
match m;
gfc_compile_state s;
-
- gfc_enclosing_unit (&s);
- if (s == COMP_PROGRAM
- && gfc_notify_std (GFC_STD_GNU, "Extension: RETURN statement in "
- "main program at %C") == FAILURE)
- return MATCH_ERROR;
+ int c;
e = NULL;
if (gfc_match_eos () == MATCH_YES)
goto cleanup;
}
- m = gfc_match ("% %e%t", &e);
+ if (gfc_current_form == FORM_FREE)
+ {
+ /* The following are valid, so we can't require a blank after the
+ RETURN keyword:
+ return+1
+ return(1) */
+ c = gfc_peek_char ();
+ if (ISALPHA (c) || ISDIGIT (c))
+ return MATCH_NO;
+ }
+
+ m = gfc_match (" %e%t", &e);
if (m == MATCH_YES)
goto done;
if (m == MATCH_ERROR)
return MATCH_ERROR;
done:
+ gfc_enclosing_unit (&s);
+ if (s == COMP_PROGRAM
+ && gfc_notify_std (GFC_STD_GNU, "Extension: RETURN statement in "
+ "main program at %C") == FAILURE)
+ return MATCH_ERROR;
+
new_st.op = EXEC_RETURN;
new_st.expr = e;
-2005-05-06 J"orn Rennecke <joern.rennecke@st.com>
+2005-05-09 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
+
+ * gfortran.dg/return_1.f90: New test.
+
+2005-05-09 J"orn Rennecke <joern.rennecke@st.com>
* gcc.dg/pr15784-3.c: Add -fno-finite-math-only option.
--- /dev/null
+! { dg-do compile }
+! Test cases where no blank is required after RETURN
+subroutine sub(*)
+return(1)
+return1 ! { dg-error }
+end subroutine