Index: gcc/fortran/match.c
===================================================================
--- gcc/fortran/match.c	(revision 197388)
+++ gcc/fortran/match.c	(working copy)
@@ -4040,10 +4040,6 @@ gfc_match_return (void)
       goto cleanup;
     }
 
-  if (gfc_notify_std (GFC_STD_F95_OBS, "Alternate RETURN "
-		      "at %C") == FAILURE)
-    return MATCH_ERROR;
-
   if (gfc_current_form == FORM_FREE)
     {
       /* The following are valid, so we can't require a blank after the
Index: gcc/fortran/primary.c
===================================================================
--- gcc/fortran/primary.c	(revision 197388)
+++ gcc/fortran/primary.c	(working copy)
@@ -1719,6 +1719,10 @@ gfc_match_actual_arglist (int sub_flag, gfc_actual
 	  if (m != MATCH_YES)
 	    goto cleanup;
 
+	  if (gfc_notify_std (GFC_STD_F95_OBS, "Alternate-return argument "
+	      "at %C") == FAILURE)
+	    goto cleanup;
+
 	  tail->label = label;
 	  goto next;
 	}
Index: gcc/testsuite/gfortran.dg/altreturn_1.f90
===================================================================
--- gcc/testsuite/gfortran.dg/altreturn_1.f90	(revision 197388)
+++ gcc/testsuite/gfortran.dg/altreturn_1.f90	(working copy)
@@ -1,4 +1,6 @@
 ! { dg-do compile }
+! { dg-options "-std=gnu" }
+
        subroutine foo (a)
        real t, a, baz
        call bar (*10)
Index: gcc/testsuite/gfortran.dg/altreturn_3.f90
===================================================================
--- gcc/testsuite/gfortran.dg/altreturn_3.f90	(revision 197388)
+++ gcc/testsuite/gfortran.dg/altreturn_3.f90	(working copy)
@@ -1,5 +1,5 @@
 ! { dg-do run }
-! { dg-options "-std=legacy" }
+! { dg-options "-std=gnu" }
 !
 ! Tests the fix for PR30236, which was due to alternate returns
 ! in generic interfaces causing a segfault.  They now work
Index: gcc/testsuite/gfortran.dg/altreturn_4.f90
===================================================================
--- gcc/testsuite/gfortran.dg/altreturn_4.f90	(revision 197388)
+++ gcc/testsuite/gfortran.dg/altreturn_4.f90	(working copy)
@@ -1,4 +1,6 @@
 ! { dg-do compile }
+! { dg-options "-std=gnu" }
+!
 ! Tests the fix for PR28172, in which an ICE would result from
 ! the contained call with an alternate retrun.
 
Index: gcc/testsuite/gfortran.dg/altreturn_5.f90
===================================================================
--- gcc/testsuite/gfortran.dg/altreturn_5.f90	(revision 197388)
+++ gcc/testsuite/gfortran.dg/altreturn_5.f90	(working copy)
@@ -1,33 +1,32 @@
-! { dg-do run }
-! { dg-options "-std=legacy" }
-!
-! Tests the fix for PR31483, in which dummy argument procedures
-! produced an ICE if they had an alternate return.
-!
-! Contributed by Mathias Fröhlich <M.Froehlich@science-computing.de>
-
-      SUBROUTINE R (i, *, *)
-      INTEGER i
-      RETURN i
-      END
-
+! { dg-do run }
+! { dg-options "-std=gnu" }
+!
+! Tests the fix for PR31483, in which dummy argument procedures
+! produced an ICE if they had an alternate return.
+!
+! Contributed by Mathias Fröhlich <M.Froehlich@science-computing.de>
+
+      SUBROUTINE R (i, *, *)
+      INTEGER i
+      RETURN i
+      END
+
       SUBROUTINE PHLOAD (READER, i, res)
       IMPLICIT NONE
-      EXTERNAL         READER
-      integer i
+      EXTERNAL         READER
+      integer i
       character(3) res
       CALL READER (i, *1, *2)
- 1    res = "one"
+ 1    res = "one"
       return
- 2    res = "two"
+ 2    res = "two"
       return
-      END
-
-      EXTERNAL R
+      END
+
+      EXTERNAL R
       character(3) res
-      call PHLOAD (R, 1, res)
-      if (res .ne. "one") call abort ()
-      CALL PHLOAD (R, 2, res)
-      if (res .ne. "two") call abort ()
+      call PHLOAD (R, 1, res)
+      if (res .ne. "one") call abort ()
+      CALL PHLOAD (R, 2, res)
+      if (res .ne. "two") call abort ()
       END
-
Index: gcc/testsuite/gfortran.dg/altreturn_6.f90
===================================================================
--- gcc/testsuite/gfortran.dg/altreturn_6.f90	(revision 197388)
+++ gcc/testsuite/gfortran.dg/altreturn_6.f90	(working copy)
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-std=legacy" }
+! { dg-options "-std=gnu" }
 !
 ! PR 32938
 subroutine r (*)
Index: gcc/testsuite/gfortran.dg/altreturn_7.f90
===================================================================
--- gcc/testsuite/gfortran.dg/altreturn_7.f90	(revision 197388)
+++ gcc/testsuite/gfortran.dg/altreturn_7.f90	(working copy)
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-std=legacy" }
+! { dg-options "-std=gnu" }
 !
 ! PR 40848: [4.5 Regression] ICE with alternate returns
 !
