From d1bb76287ec58fdde7ced70088559136555bd7bd Mon Sep 17 00:00:00 2001
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
Date: Fri, 11 Dec 2015 17:04:09 +0000
Subject: [PATCH 03/23] Add -std=extra-legacy
0003-Add-std-extra-legacy.patch
0023-Add-a-full-stop-to-the-std-extra-legacy-help-text.patch
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 4421ce4..4808c27 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -790,6 +790,10 @@ std=legacy
Fortran
Accept extensions to support legacy code.
+std=extra-legacy
+Fortran
+Accept even more legacy extensions, including things disallowed in f90.
+
undef
Fortran
; Documented in C
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index c5ff992..dcc923b 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
gfortran.texi. */
/* For now, use F2015 = GFC_STD_GNU. */
#define GFC_STD_F2015 (1<<5) /* PLACEHOLDER for Fortran 2015. */
+#define GFC_STD_EXTRA_LEGACY (1<<10) /* Even more backward compatibility. */
#define GFC_STD_F2008_TS (1<<9) /* POST-F2008 technical reports. */
#define GFC_STD_F2008_OBS (1<<8) /* Obsolescent in F2008. */
#define GFC_STD_F2008 (1<<7) /* New in F2008. */
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 1af76aa..9ebf8e3 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -733,6 +733,12 @@ gfc_handle_option (size_t scode, const char *arg, int value,
gfc_option.warn_std = 0;
break;
+ case OPT_std_extra_legacy:
+ set_default_std_flags ();
+ gfc_option.warn_std = 0;
+ gfc_option.allow_std |= GFC_STD_EXTRA_LEGACY;
+ break;
+
case OPT_fshort_enums:
/* Handled in language-independent code. */
break;