[Bug fortran/37468] unknown option -i<something> not recognized by gfortran driver
dfranke at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Nov 28 23:04:00 GMT 2008
------- Comment #6 from dfranke at gcc dot gnu dot org 2008-11-28 23:02 -------
In gcc.c (cpp_unique_options) we have "%{i*}" which passes on any -i<something>
it might encounter, including -i8. This is why we get an error if preprocessing
is enabled, as -i8 is not known. So, the problem is not getting an error with
.F, but getting no error with .f!
Now, looking for the whereabouts of -i8, one sees with -v that it's not passed
to f951, hence it was eaten by the driver?! Interestingly, using -k8, the
compiler complains: "unrecognized option '-k8'". In gcc.c (main) we find:
/* Now we have the specs.
Set the `valid' bits for switches that match anything in any spec. */
validate_all_switches ();
Which includes the cpp-spec which uses (cpp_unique_options). Thus, we have a
pass interested in the '-i8', namely cpp, which then is never run. In order to
make f951 complain about -i*, we need to forward it in the specs. Otherwise it
will be simply skipped - to be used with a pass never run.
Propsed patch for trunk/4.4 (not regtested yet):
Index: lang-specs.h
===================================================================
--- lang-specs.h (revision 142255)
+++ lang-specs.h (working copy)
@@ -23,7 +23,7 @@
#define F951_CPP_OPTIONS "%{!nocpp: -cpp %g.f90 %(cpp_options)\
%{E|M|MM:%(cpp_debug_options) -fsyntax-only} %{E}}"
-#define F951_OPTIONS "%(cc1_options) %{J*} %{!cpp: %{I*}}\
+#define F951_OPTIONS "%(cc1_options) %{J*} %{!cpp: %{I*} %{i*}}\
%{!nostdinc:-fintrinsic-modules-path finclude%s}\
%{!fsyntax-only:%(invoke_as)}"
#define F951_SOURCE_FORM "%{!ffree-form:-ffixed-form}"
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
AssignedTo|unassigned at gcc dot gnu |dfranke at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
GCC host triplet|(amd64 - Debian testing - |
|gfortran-4.3 |
Keywords| |patch
Last reconfirmed|2008-09-14 14:20:15 |2008-11-28 23:02:59
date| |
Summary|error when combining -i8 |unknown option -i<something>
|with .F files |not recognized by gfortran
| |driver
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37468
More information about the Gcc-bugs
mailing list