This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR fortran/9038, a regression in 3.3/3.4 with respect to 3.2.


hi -

FYI -- here's the workaround for this problem that i've been using
in my local tree.  I thought that this was too ugly to propose as a fix ---
but since nothing better has come up, i figured i'd pass this along.
sss

Index: gcc/f/lang-specs.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/f/lang-specs.h,v
retrieving revision 1.37
diff -u -p -r1.37 lang-specs.h
--- gcc/f/lang-specs.h	26 Jan 2003 19:26:35 -0000	1.37
+++ gcc/f/lang-specs.h	20 Feb 2003 01:47:06 -0000
@@ -29,7 +29,7 @@ the Free Software Foundation, 59 Temple 
   {".fpp", "@f77-cpp-input", 0},
   {".FPP", "@f77-cpp-input", 0},
   {"@f77-cpp-input",
-   "cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
+   "cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %:clean-f(%(cpp_options)) \
         %{E|M|MM:%(cpp_debug_options)}\
         %{!M:%{!MM:%{!E: %|.f |\n\
     f771 %|.f %(cc1_options) %{I*} %{!fsyntax-only:%(invoke_as)}}}}", 0},
Index: gcc/f/g77spec.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/f/g77spec.c,v
retrieving revision 1.40
diff -u -p -r1.40 g77spec.c
--- gcc/f/g77spec.c	16 Dec 2002 18:22:28 -0000	1.40
+++ gcc/f/g77spec.c	20 Feb 2003 01:47:14 -0000
@@ -96,6 +96,9 @@ static void lookup_option PARAMS ((Optio
 				   const char *));
 static void append_arg PARAMS ((const char *));
 
+static const char*
+clean_f_spec_function PARAMS ((int argc, const char** argv));
+
 /* The new argument list will be built here.  */
 static int g77_newargc;
 static const char **g77_newargv;
@@ -556,6 +559,36 @@ or type the command `info -f g77 Copying
   *in_argv = g77_newargv;
 }
 
+
+static const char*
+clean_f_spec_function (argc, argv)
+     int argc;
+     const char** argv;
+{
+  int totlen = 0;
+  int i;
+  char* ret;
+  for (i=0; i < argc; i++)
+    totlen += strlen (argv[i]) + 1;
+  ret = xmalloc (totlen + 1);
+  ret[0] = '\0';
+  for (i=0; i < argc; i++) {
+    if (strcmp (argv[i], "-") == 0) {
+      if (i < argc-1 && strncmp (argv[i+1], "ffixed", 6) == 0) {
+        ++i;
+        continue;
+      }
+      strcat (ret, "-");
+    }
+    else {
+      strcat (ret, argv[i]);
+      strcat (ret, " ");
+    }
+  }
+  return ret;
+}
+
+
 /* Called before linking.  Returns 0 on success and -1 on failure. */
 int lang_specific_pre_link ()  /* Not used for F77. */
 {
@@ -568,5 +601,6 @@ int lang_specific_extra_outfiles = 0;  /
 /* Table of language-specific spec functions.  */ 
 const struct spec_function lang_specific_spec_functions[] =
 {
+  { "clean-f",  clean_f_spec_function},
   { 0, 0 }
 };


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]