]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: Use non conflicting file extensions for intermediates [PR81615]
authorRimvydas Jasinskas <rimvydas.jas@gmail.com>
Wed, 20 Dec 2023 03:39:33 +0000 (03:39 +0000)
committerHarald Anlauf <anlauf@gmx.de>
Wed, 20 Dec 2023 19:22:54 +0000 (20:22 +0100)
gcc/ChangeLog:

* doc/invoke.texi: Document the new file extensions

gcc/fortran/ChangeLog:

PR fortran/81615
* lang-specs.h (F951_CPP_OPTIONS): Do not hardcode ".f90" extension
(F951_CPP_EXTENSION): Use .fi/.fii for fixed/free form sources
* options.cc (form_from_filename): Handle the new extensions

Signed-off-by: Rimvydas Jasinskas <rimvydas.jas@gmail.com>
gcc/doc/invoke.texi
gcc/fortran/lang-specs.h
gcc/fortran/options.cc

index 5af978b0a670920cca9fad6ef4d8468e20bdc3b2..d272b9228dd9fa8730e9812be8157054a924340d 100644 (file)
@@ -1592,6 +1592,7 @@ C++ header file to be turned into a precompiled header or Ada spec.
 @item @var{file}.f
 @itemx @var{file}.for
 @itemx @var{file}.ftn
+@itemx @var{file}.fi
 Fixed form Fortran source code that should not be preprocessed.
 
 @item @var{file}.F
@@ -1606,6 +1607,7 @@ preprocessor).
 @itemx @var{file}.f95
 @itemx @var{file}.f03
 @itemx @var{file}.f08
+@itemx @var{file}.fii
 Free form Fortran source code that should not be preprocessed.
 
 @item @var{file}.F90
index 7b298457613d331bc1c2cebdf7ce54766ffe046e..5b1ea00cf0d8a45ffb7b71aaaa81980c8e2e8b2f 100644 (file)
@@ -29,7 +29,8 @@
 /* Options that f951 should know about, even if not preprocessing.  */
 #define CPP_FORWARD_OPTIONS "%{i*} %{I*} %{M*}"
 
-#define F951_CPP_OPTIONS    "%{!nocpp: -cpp=%g.f90 %{E} %(cpp_unique_options) \
+#define F951_CPP_OPTIONS    "%{!nocpp: -cpp=%g" F951_CPP_EXTENSION \
+                            " %{E} %(cpp_unique_options) \
                             %{E|M|MM:%(cpp_debug_options) " CPP_ONLY_OPTIONS \
                             " -fsyntax-only};: " CPP_FORWARD_OPTIONS "}"
 
@@ -44,6 +45,7 @@
 #define F951_SOURCE_FORM    "%{!ffree-form:-ffixed-form}"
 
 
+#define F951_CPP_EXTENSION  ".fi"
 {".F",   "@f77-cpp-input", 0, 0, 0},
 {".FOR", "@f77-cpp-input", 0, 0, 0},
 {".FTN", "@f77-cpp-input", 0, 0, 0},
 {".f",   "@f77", 0, 0, 0},
 {".for", "@f77", 0, 0, 0},
 {".ftn", "@f77", 0, 0, 0},
+{".fi",  "@f77", 0, 0, 0},
 {"@f77",
     "f951 %i " F951_SOURCE_FORM " \
           %{E:%{!cpp:%egfortran does not support -E without -cpp}} \
           %{cpp:" F951_CPP_OPTIONS ";: " CPP_FORWARD_OPTIONS  "} \
          %{!E:" F951_OPTIONS "}", 0, 0, 0},
+
+#undef F951_CPP_EXTENSION
+#define F951_CPP_EXTENSION  ".fii"
 {".F90", "@f95-cpp-input", 0, 0, 0},
 {".F95", "@f95-cpp-input", 0, 0, 0},
 {".F03", "@f95-cpp-input", 0, 0, 0},
@@ -70,6 +76,7 @@
 {".f95", "@f95", 0, 0, 0},
 {".f03", "@f95", 0, 0, 0},
 {".f08", "@f95", 0, 0, 0},
+{".fii", "@f95", 0, 0, 0},
 {"@f95",
     "f951 %i %{E:%{!cpp:%egfortran does not support -E without -cpp}}\
          %{cpp:" F951_CPP_OPTIONS ";:  " CPP_FORWARD_OPTIONS  "} \
@@ -79,5 +86,6 @@
 #undef CPP_ONLY_OPTIONS
 #undef CPP_FORWARD_OPTIONS
 #undef F951_SOURCE_FORM
+#undef F951_CPP_EXTENSION
 #undef F951_CPP_OPTIONS
 #undef F951_OPTIONS
index 02a29f83b582be58b240f0519b0ab48eaca8de18..53a6e8553bb1d62b288fd2d287fdf9967880c3db 100644 (file)
@@ -199,6 +199,12 @@ form_from_filename (const char *filename)
     ".f08", FORM_FREE}
     ,
     {
+    ".fii", FORM_FREE}
+    ,
+    {
+    ".fi", FORM_FIXED}
+    ,
+    {
     ".f", FORM_FIXED}
     ,
     {