OSDN Git Service

Remove CYGNUS LOCAL tags.
[pf3gnuchains/gcc-fork.git] / gcc / toplev.c
index 532ac4e..5d5eb45 100644 (file)
@@ -1,5 +1,5 @@
 /* Top level of GNU C compiler
-   Copyright (C) 1987, 88, 89, 92, 93, 94, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1987, 88, 89, 92-5, 1996 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 /* This is the top level of cc1/c++.
    It parses command args, opens files, invokes the various passes
@@ -35,7 +36,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <ctype.h>
 #include <sys/stat.h>
 
-#ifndef WINNT
+#ifndef _WIN32
 #ifdef USG
 #undef FLOAT
 #include <sys/param.h>
@@ -137,9 +138,18 @@ void fancy_abort ();
 void abort ();
 #endif
 void set_target_switch ();
-static void print_switch_values ();
 static char *decl_name ();
 
+void print_version ();
+int print_single_switch ();
+void print_switch_values ();
+/* Length of line when printing switch values.  */
+#define MAX_LINE 75
+
+#ifdef __alpha
+extern char *sbrk ();
+#endif
+
 /* Name of program invoked, sans directories.  */
 
 char *progname;
@@ -267,6 +277,10 @@ void (*incomplete_decl_finalize_hook) () = 0;
 
 void (*interim_eh_hook)        PROTO((tree));
 
+/* Highest label number used at the end of reload.  */
+
+int max_label_num_after_reload;
+
 /* Nonzero if generating code to do profiling.  */
 
 int profile_flag = 0;
@@ -398,6 +412,11 @@ int flag_no_function_cse = 0;
 
 int flag_omit_frame_pointer = 0;
 
+/* Nonzero means place each function into its own section on those platforms
+   which support arbitrary section names and unlimited numbers of sections.  */
+
+int flag_function_sections = 0;
+
 /* Nonzero to inhibit use of define_optimization peephole opts.  */
 
 int flag_no_peephole = 0;
@@ -468,7 +487,8 @@ int flag_short_temps;
 
 int flag_pic;
 
-/* Nonzero means place uninitialized global data in the bss section. */
+/* Nonzero means don't place uninitialized global data in common storage
+   by default. */
 
 int flag_no_common;
 
@@ -500,9 +520,20 @@ int flag_inhibit_size_directive = 0;
 /* -fverbose-asm causes extra commentary information to be produced in
    the generated assembly code (to make it more readable).  This option
    is generally only of use to those who actually need to read the
-   generated assembly code (perhaps while debugging the compiler itself).  */
+   generated assembly code (perhaps while debugging the compiler itself).
+   -fverbose-asm is the default.  -fno-verbose-asm causes the extra information
+   to be omitted and is useful when comparing two assembler files.  */
 
-int flag_verbose_asm = 0;
+int flag_verbose_asm = 1;
+
+/* -dA causes debug commentary information to be produced in
+   the generated assembly code (to make it more readable).  This option
+   is generally only of use to those who actually need to read the
+   generated assembly code (perhaps while debugging the compiler itself).
+   Currently, this switch is only used by dwarfout.c; however, it is intended
+   to be a catchall for printing debug information in the assembler file.  */
+
+int flag_debug_asm = 0;
 
 /* -fgnu-linker specifies use of the GNU linker for initializations.
    (Or, more generally, a linker that handles initializations.)
@@ -513,6 +544,9 @@ int flag_gnu_linker = 0;
 int flag_gnu_linker = 1;
 #endif
 
+/* Tag all structures with __attribute__(packed) */
+int flag_pack_struct = 0;
+
 /* Table of language-independent -f options.
    STRING is the option name.  VARIABLE is the address of the variable.
    ON_VALUE is the value to store in VARIABLE
@@ -556,8 +590,10 @@ struct { char *string; int *variable; int on_value;} f_options[] =
   {"fast-math", &flag_fast_math, 1},
   {"common", &flag_no_common, 0},
   {"inhibit-size-directive", &flag_inhibit_size_directive, 1},
+  {"function-sections", &flag_function_sections, 1},
   {"verbose-asm", &flag_verbose_asm, 1},
   {"gnu-linker", &flag_gnu_linker, 1},
+  {"pack-struct", &flag_pack_struct, 1},
   {"bytecode", &output_bytecode, 1}
 };
 
@@ -630,6 +666,8 @@ char *lang_options[] =
   "-Wno-pointer-arith",
   "-Wredundant-decls",
   "-Wno-redundant-decls",
+  "-Wsign-compare",
+  "-Wno-sign-compare",
   "-Wstrict-prototypes",
   "-Wno-strict-prototypes",
   "-Wtraditional",
@@ -639,88 +677,6 @@ char *lang_options[] =
   "-Wwrite-strings",
   "-Wno-write-strings",
 
-  /* These are for C++.  */
-  "-+e0",                      /* gcc.c tacks the `-' on the front.  */
-  "-+e1",
-  "-+e2",
-  "-faccess-control",
-  "-fno-access-control",
-  "-fall-virtual",
-  "-fno-all-virtual",
-  "-falt-external-templates",
-  "-fno-alt-external-templates",
-  "-fansi-overloading",
-  "-fno-ansi-overloading",
-  "-fcadillac",
-  "-fno-cadillac",
-  "-fcheck-new",
-  "-fno-check-new",
-  "-fconserve-space",
-  "-fno-conserve-space",
-  "-fdefault-inline",
-  "-fno-default-inline",
-  "-frtti",
-  "-fno-rtti",
-  "-felide-constructors",
-  "-fno-elide-constructors",
-  "-fenum-int-equiv",
-  "-fno-enum-int-equiv",
-  "-fexternal-templates",
-  "-fno-external-templates",
-  "-fgc",
-  "-fno-gc",
-  "-fgnu-keywords",
-  "-fno-gnu-keywords",
-  "-fhandle-exceptions",
-  "-fno-handle-exceptions",
-  "-fhandle-signatures",
-  "-fno-handle-signatures",
-  "-fhuge-objects",
-  "-fno-huge-objects",
-  "-fimplement-inlines",
-  "-fno-implement-inlines",
-  "-fimplicit-templates",
-  "-fno-implicit-templates",
-  "-flabels-ok",
-  "-fno-labels-ok",
-  "-fmemoize-lookups",
-  "-fno-memoize-lookups",
-  "-fnonnull-objects",
-  "-fno-nonnull-objects",
-  "-foperator-names",
-  "-fno-operator-names",
-  "-fsave-memoized",
-  "-fno-save-memoized",
-  "-fshort-temps",
-  "-fno-short-temps",
-  "-fstats",
-  "-fno-stats",
-  "-fstrict-prototype",
-  "-fno-strict-prototype",
-  "-fthis-is-variable",
-  "-fno-this-is-variable",
-  "-fvtable-thunks",
-  "-fno-vtable-thunks",
-  "-fxref",
-  "-fno-xref",
-
-  "-Wreturn-type",
-  "-Wno-return-type",
-  "-Woverloaded-virtual",
-  "-Wno-overloaded-virtual",
-  "-Wtemplate-debugging",
-  "-Wno-template-debugging",
-  "-Wctor-dtor-privacy",
-  "-Wno-ctor-dtor-privacy",
-  "-Wnon-virtual-dtor",
-  "-Wno-non-virtual-dtor",
-  "-Wextern-inline",
-  "-Wno-extern-inline",
-  "-Wreorder",
-  "-Wno-reorder",
-  "-Wsynth",
-  "-Wno-synth",
-
   /* these are for obj c */
   "-lang-objc",
   "-gen-decls",
@@ -733,75 +689,7 @@ char *lang_options[] =
   "-Wprotocol",
   "-Wno-protocol",
 
-  /* THESE ARE FOR FORTRAN. */
-  "-fversion",
-  "-ff90",
-  "-fno-f90",
-  "-fautomatic",
-  "-fno-automatic",
-  "-fdollar-ok",
-  "-fno-dollar-ok",
-  "-ff2c",
-  "-fno-f2c",
-  "-ff2c-library",
-  "-fno-f2c-library",
-  "-ffree-form",
-  "-fno-free-form",
-  "-ffixed-form",
-  "-fno-fixed-form",
-  "-fpedantic",
-  "-fno-pedantic",
-  "-fvxt-not-f90",
-  "-ff90-not-vxt",
-  "-fugly",
-  "-fno-ugly",
-  "-fdebug",
-  "-fno-debug",
-  "-fintrin-case-initcap",
-  "-fintrin-case-upper",
-  "-fintrin-case-lower",
-  "-fintrin-case-any",
-  "-fmatch-case-initcap",
-  "-fmatch-case-upper",
-  "-fmatch-case-lower",
-  "-fmatch-case-any",
-  "-fsource-case-upper",
-  "-fsource-case-upper",
-  "-fsource-case-lower",
-  "-fsource-case-preserve",
-  "-fsymbol-case-initcap",
-  "-fsymbol-case-upper",
-  "-fsymbol-case-lower",
-  "-fsymbol-case-any",
-  "-fcase-strict-upper",
-  "-fcase-strict-lower",
-  "-fcase-initcap",
-  "-fcase-upper",
-  "-fcase-lower",
-  "-fcase-preserve",
-  "-fdcp-intrinsics-delete",
-  "-fdcp-intrinsics-hide",
-  "-fdcp-intrinsics-disable",
-  "-fdcp-intrinsics-enable",
-  "-ff2c-intrinsics-delete",
-  "-ff2c-intrinsics-hide",
-  "-ff2c-intrinsics-disable",
-  "-ff2c-intrinsics-enable",
-  "-ff90-intrinsics-delete",
-  "-ff90-intrinsics-hide",
-  "-ff90-intrinsics-disable",
-  "-ff90-intrinsics-enable",
-  "-fmil-intrinsics-delete",
-  "-fmil-intrinsics-hide",
-  "-fmil-intrinsics-disable",
-  "-fmil-intrinsics-enable",
-  "-fvxt-intrinsics-delete",
-  "-fvxt-intrinsics-hide",
-  "-fvxt-intrinsics-disable",
-  "-fvxt-intrinsics-enable",
-
-  /* This is for GNAT and is temporary.  */
-  "-gnat",
+#include "options.h"
   0
 };
 \f
@@ -929,7 +817,7 @@ int dump_time;
 int
 get_run_time ()
 {
-#ifndef WINNT
+#ifndef _WIN32
 #ifdef USG
   struct tms tms;
 #else
@@ -949,12 +837,12 @@ get_run_time ()
 
   if (quiet_flag)
     return 0;
-#ifdef WINNT
+#ifdef _WIN32
   if (clock() < 0)
     return 0;
   else
     return (clock() * 1000);
-#else /* not WINNT */
+#else /* not _WIN32 */
 #ifdef USG
   times (&tms);
   return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
@@ -1019,7 +907,7 @@ pfatal_with_name (name)
 {
   fprintf (stderr, "%s: ", progname);
   perror (name);
-  exit (35);
+  exit (FATAL_EXIT_CODE);
 }
 
 void
@@ -1027,7 +915,7 @@ fatal_io_error (name)
      char *name;
 {
   fprintf (stderr, "%s: %s: I/O error\n", progname, name);
-  exit (35);
+  exit (FATAL_EXIT_CODE);
 }
 
 /* Called to give a better error message for a bad insn rather than
@@ -1075,6 +963,8 @@ fatal_insn (message, insn)
     fflush (dbr_sched_dump_file);
   if (stack_reg_dump_file)
     fflush (stack_reg_dump_file);
+  fflush (stdout);
+  fflush (stderr);
   abort ();
 }
 
@@ -1141,21 +1031,13 @@ announce_function (decl)
     }
 }
 
-/* Prints out, if necessary, the name of the current function
-   which caused an error.  Called from all error and warning functions.  */
+/* The default function to print out name of current function that caused
+   an error.  */
 
 void
-report_error_function (file)
+default_print_error_function (file)
      char *file;
 {
-  struct file_stack *p;
-
-  if (need_error_newline)
-    {
-      fprintf (stderr, "\n");
-      need_error_newline = 0;
-    }
-
   if (last_error_function != current_function_decl)
     {
       char *kind = "function";
@@ -1176,8 +1058,33 @@ report_error_function (file)
 
       last_error_function = current_function_decl;
     }
+}
+
+/* Called by report_error_function to print out function name.
+ * Default may be overridden by language front-ends. */
+
+void (*print_error_function) PROTO((char*)) = default_print_error_function;
+
+/* Prints out, if necessary, the name of the current function
+  that caused an error.  Called from all error and warning functions.  */
+
+void
+report_error_function (file)
+     char *file;
+{
+  struct file_stack *p;
+
+  if (need_error_newline)
+    {
+      fprintf (stderr, "\n");
+      need_error_newline = 0;
+    }
+
+  (*print_error_function) (file);
+
   if (input_file_stack && input_file_stack->next != 0
-      && input_file_stack_tick != last_error_tick)
+      && input_file_stack_tick != last_error_tick
+      && file == input_filename)
     {
       fprintf (stderr, "In file included");
       for (p = input_file_stack->next; p; p = p->next)
@@ -1209,7 +1116,8 @@ vmessage (prefix, s, ap)
     HOST_WIDE_INT v1 = va_arg(ap, HOST_WIDE_INT);
     HOST_WIDE_INT v2 = va_arg(ap, HOST_WIDE_INT);
     HOST_WIDE_INT v3 = va_arg(ap, HOST_WIDE_INT);
-    fprintf (stderr, s, v1, v2, v3);
+    HOST_WIDE_INT v4 = va_arg(ap, HOST_WIDE_INT);
+    fprintf (stderr, s, v1, v2, v3, v4);
   }
 #endif
 }
@@ -1478,7 +1386,7 @@ vfatal (s, ap)
      va_list ap;
 {
   verror (s, ap);
-  exit (34);
+  exit (FATAL_EXIT_CODE);
 }
 
 void
@@ -1876,6 +1784,20 @@ xrealloc (ptr, size)
     fatal ("virtual memory exhausted");
   return result;
 }
+
+/* Same as `strdup' but report error if no memory available.  */
+
+char *
+xstrdup (s)
+     register char *s;
+{
+  register char *result = (char *) malloc (strlen (s) + 1);
+
+  if (! result)
+    fatal ("virtual memory exhausted");
+  strcpy (result, s);
+  return result;
+}
 \f
 /* Return the logarithm of X, base 2, considering X unsigned,
    if X is a power of 2.  Otherwise, returns -1.
@@ -1986,39 +1908,21 @@ pipe_closed (signo)
 }
 
 /* Strip off a legitimate source ending from the input string NAME of
-   length LEN. */
+   length LEN.  Rather than having to know the names used by all of
+   our front ends, we strip off an ending of a period followed by one,
+   two, or three characters.  */
 
 void
 strip_off_ending (name, len)
      char *name;
      int len;
 {
-  if (len > 2 && ! strcmp (".c", name + len - 2))
-    name[len - 2] = 0;
-  else if (len > 2 && ! strcmp (".m", name + len - 2))
-    name[len - 2] = 0;
-  else if (len > 2 && ! strcmp (".i", name + len - 2))
-    name[len - 2] = 0;
-  else if (len > 3 && ! strcmp (".ii", name + len - 3))
-    name[len - 3] = 0;
-  else if (len > 3 && ! strcmp (".co", name + len - 3))
-    name[len - 3] = 0;
-  else if (len > 3 && ! strcmp (".cc", name + len - 3))
-    name[len - 3] = 0;
-  else if (len > 2 && ! strcmp (".C", name + len - 2))
-    name[len - 2] = 0;
-  else if (len > 4 && ! strcmp (".cxx", name + len - 4))
-    name[len - 4] = 0;
-  else if (len > 4 && ! strcmp (".cpp", name + len - 4))
-    name[len - 4] = 0;
-  else if (len > 2 && ! strcmp (".f", name + len - 2))
-    name[len - 2] = 0;
-  /* Ada will use extensions like .ada, .adb, and .ads, so just test
-     for "ad".  */
-  else if (len > 4 && ! strncmp (".ad", name + len - 4, 3))
-    name[len - 4] = 0;
-  else if (len > 4 && ! strcmp (".atr", name + len - 4))
-    name[len - 4] = 0;
+  if (len > 2 && name[len - 2] == '.')
+    name[len - 2] = '\0';
+  else if (len > 3 && name[len - 3] == '.')
+    name[len - 3] = '\0';
+  else if (len > 4 && name[len - 4] == '.')
+    name[len - 4] = '\0';
 }
 
 /* Output a quoted string.  */
@@ -2290,6 +2194,19 @@ compile_file (name)
   if (!output_bytecode)
     {
       ASM_FILE_START (asm_out_file);
+
+#ifdef ASM_COMMENT_START
+      if (flag_verbose_asm)
+       {
+         /* Print the list of options in effect.  */
+         print_version (asm_out_file, ASM_COMMENT_START);
+         print_switch_values (asm_out_file, 0, MAX_LINE,
+                              ASM_COMMENT_START, " ", "\n");
+         /* Add a blank line here so it appears in assembler output but not
+            screen output.  */
+         fprintf (asm_out_file, "\n");
+       }
+#endif
     }
 
   /* Output something to inform GDB that this compilation was by GCC.  Also
@@ -2310,6 +2227,24 @@ compile_file (name)
   ASM_IDENTIFY_LANGUAGE (asm_out_file);
 #endif
 
+#ifndef ASM_OUTPUT_SECTION_NAME
+  if (flag_function_sections)
+    {
+      warning ("-ffunction-sections not supported for this target.");
+      flag_function_sections = 0;
+    }
+#endif
+
+  if (flag_function_sections
+      && (profile_flag || profile_block_flag))
+    {
+      warning ("-ffunction-sections disabled; it makes profiling impossible.");
+      flag_function_sections = 0;
+    }
+
+  if (flag_function_sections && write_symbols != NO_DEBUG)
+    warning ("-ffunction-sections may affect debugging on some targets.");
+
   if (output_bytecode)
     {
       if (profile_flag || profile_block_flag)
@@ -2492,6 +2427,7 @@ compile_file (name)
                || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
            && DECL_INITIAL (decl) == 0
            && DECL_EXTERNAL (decl)
+           && ! DECL_ARTIFICIAL (decl)
            && ! TREE_PUBLIC (decl))
          {
            pedwarn_with_decl (decl, 
@@ -2511,7 +2447,7 @@ compile_file (name)
            && ! DECL_EXTERNAL (decl)
            && ! TREE_PUBLIC (decl)
            && ! TREE_USED (decl)
-           && ! DECL_REGISTER (decl)
+           && (TREE_CODE (decl) == FUNCTION_DECL || ! DECL_REGISTER (decl))
            /* The TREE_USED bit for file-scope decls
               is kept in the identifier, to handle multiple
               external decls in different scopes.  */
@@ -2552,6 +2488,10 @@ compile_file (name)
       }
   }
 
+  /* Write out any pending weak symbol declarations.  */
+
+  weak_finish ();
+
   /* Do dbx symbols */
 #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
   if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
@@ -2729,7 +2669,8 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
                        && (DECL_INITIAL (decl) == 0
                            || DECL_INITIAL (decl) == error_mark_node)))
                   assemble_variable (decl, top_level, at_end, 0);
-              if (decl == last_assemble_variable_decl)
+              if (!output_bytecode
+                  && decl == last_assemble_variable_decl)
                 {
                   ASM_FINISH_DECLARE_OBJECT (asm_out_file, decl,
                                              top_level, at_end);
@@ -2803,21 +2744,18 @@ rest_of_compilation (decl)
 
   if (DECL_SAVED_INSNS (decl) == 0)
     {
-      int specd = DECL_INLINE (decl);
+      int inlineable = 0;
       char *lose;
 
       /* If requested, consider whether to make this function inline.  */
-      if (specd || flag_inline_functions)
+      if (DECL_INLINE (decl) || flag_inline_functions)
        TIMEVAR (integration_time,
                 {
                   lose = function_cannot_inline_p (decl);
-                  /* If not optimzing, then make sure the DECL_INLINE
-                     bit is off.  */
                   if (lose || ! optimize)
                     {
-                      if (warn_inline && specd)
+                      if (warn_inline && DECL_INLINE (decl))
                         warning_with_decl (decl, lose);
-                      DECL_INLINE (decl) = 0;
                       DECL_ABSTRACT_ORIGIN (decl) = 0;
                       /* Don't really compile an extern inline function.
                          If we can't make it inline, pretend
@@ -2829,7 +2767,11 @@ rest_of_compilation (decl)
                         }
                     }
                   else
-                    DECL_INLINE (decl) = 1;
+                    /* ??? Note that this has the effect of making it look
+                       like "inline" was specified for a function if we choose
+                       to inline it.  This isn't quite right, but it's
+                       probably not worth the trouble to fix.  */
+                    inlineable = DECL_INLINE (decl) = 1;
                 });
 
       insns = get_insns ();
@@ -2851,32 +2793,42 @@ rest_of_compilation (decl)
         compile it by itself, defer decision till end of compilation.
         finish_compilation will call rest_of_compilation again
         for those functions that need to be output.  Also defer those
-        functions that we are supposed to defer.  */
-
-      if (DECL_DEFER_OUTPUT (decl)
-         || ((specd || DECL_INLINE (decl))
-             && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
-                  && ! flag_keep_inline_functions)
-                 || DECL_EXTERNAL (decl))))
+        functions that we are supposed to defer.  We cannot defer
+        functions containing nested functions since the nested function
+        data is in our non-saved obstack.  */
+
+      if (! current_function_contains_functions
+         && (DECL_DEFER_OUTPUT (decl)
+             || (DECL_INLINE (decl)
+                 && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
+                      && ! flag_keep_inline_functions)
+                     || DECL_EXTERNAL (decl)))))
        {
-#ifdef DWARF_DEBUGGING_INFO
-         /* Generate the DWARF info for the "abstract" instance
-            of a function which we may later generate inlined and/or
-            out-of-line instances of.  */
-         if (write_symbols == DWARF_DEBUG)
+         DECL_DEFER_OUTPUT (decl) = 1;
+
+         /* If -Wreturn-type, we have to do a bit of compilation.  */
+         if (! warn_return_type)
            {
-             set_decl_abstract_flags (decl, 1);
-             TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
-             set_decl_abstract_flags (decl, 0);
-           }
+#ifdef DWARF_DEBUGGING_INFO
+             /* Generate the DWARF info for the "abstract" instance
+                of a function which we may later generate inlined and/or
+                out-of-line instances of.  */
+             if (write_symbols == DWARF_DEBUG)
+               {
+                 set_decl_abstract_flags (decl, 1);
+                 TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
+                 set_decl_abstract_flags (decl, 0);
+               }
 #endif
-         TIMEVAR (integration_time, save_for_inline_nocopy (decl));
-         goto exit_rest_of_compilation;
+             TIMEVAR (integration_time, save_for_inline_nocopy (decl));
+             RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl)) = inlineable;
+             goto exit_rest_of_compilation;
+           }
        }
 
       /* If we have to compile the function now, save its rtl and subdecls
         so that its compilation will not affect what others get.  */
-      if (DECL_INLINE (decl))
+      if (inlineable || DECL_DEFER_OUTPUT (decl))
        {
 #ifdef DWARF_DEBUGGING_INFO
          /* Generate the DWARF info for the "abstract" instance of
@@ -2893,15 +2845,17 @@ rest_of_compilation (decl)
          saved_block_tree = DECL_INITIAL (decl);
          saved_arguments = DECL_ARGUMENTS (decl);
          TIMEVAR (integration_time, save_for_inline_copying (decl));
+         RTX_INTEGRATED_P (DECL_SAVED_INSNS (decl)) = inlineable;
        }
 
       /* If specified extern inline but we aren't inlining it, we are
         done.  */
-      if (specd && DECL_EXTERNAL (decl))
+      if (DECL_INLINE (decl) && DECL_EXTERNAL (decl))
        goto exit_rest_of_compilation;
     }
 
-  TREE_ASM_WRITTEN (decl) = 1;
+  if (! DECL_DEFER_OUTPUT (decl))
+    TREE_ASM_WRITTEN (decl) = 1;
 
   /* Now that integrate will no longer see our rtl, we need not distinguish
      between the return value of this function and the return value of called
@@ -2945,20 +2899,14 @@ rest_of_compilation (decl)
      for all references to such slots.  */
 /*   fixup_stack_slots (); */
 
-  /* Do jump optimization the first time, if -opt.
-     Also do it if -W, but in that case it doesn't change the rtl code,
-     it only computes whether control can drop off the end of the function.  */
-
-  if (optimize > 0 || extra_warnings || warn_return_type
-      /* If function is `noreturn', we should warn if it tries to return.  */
-      || TREE_THIS_VOLATILE (decl))
-    {
-      TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
-      TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 1));
-    }
+  /* Always do one jump optimization pass to ensure that JUMP_LABEL fields
+     are initialized and to compute whether control can drop off the end
+     of the function.  */
+  TIMEVAR (jump_time, reg_scan (insns, max_reg_num (), 0));
+  TIMEVAR (jump_time, jump_optimize (insns, 0, 0, 1));
 
   /* Now is when we stop if -fsyntax-only and -Wreturn-type.  */
-  if (rtl_dump_and_exit || flag_syntax_only)
+  if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
     goto exit_rest_of_compilation;
 
   /* Dump rtl code after jump, if we are doing that.  */
@@ -3200,6 +3148,10 @@ rest_of_compilation (decl)
             fprintf (global_reg_dump_file, "\n;; Function %s\n\n",
                      IDENTIFIER_POINTER (DECL_NAME (decl))));
 
+  /* Save the last label number used so far, so reorg can tell
+     when it's safe to kill spill regs.  */
+  max_label_num_after_reload = max_label_num ();
+
   /* Unless we did stupid register allocation,
      allocate remaining pseudo-regs, then do the reload pass
      fixing up any insns that are invalid.  */
@@ -3308,12 +3260,11 @@ rest_of_compilation (decl)
     }
 #endif
 
-  if (optimize > 0)
-    /* Shorten branches.  */
-    TIMEVAR (shorten_branch_time,
-            {
-              shorten_branches (get_insns ());
-            });
+  /* Shorten branches.  */
+  TIMEVAR (shorten_branch_time,
+          {
+            shorten_branches (get_insns ());
+          });
 
 #ifdef STACK_REGS
   TIMEVAR (stack_reg_time, reg_to_stack (insns, stack_reg_dump_file));
@@ -3398,6 +3349,9 @@ rest_of_compilation (decl)
 
   reload_completed = 0;
 
+  /* Clear out the insn_length contents now that they are no longer valid.  */
+  init_insn_lengths ();
+
   /* Clear out the real_constant_chain before some of the rtx's
      it runs through become garbage.  */
 
@@ -3407,6 +3361,10 @@ rest_of_compilation (decl)
 
   resume_temporary_allocation ();
 
+  /* Show no temporary slots allocated.  */
+
+  init_temp_slots ();
+
   /* The parsing time is all the time spent in yyparse
      *except* what is spent in this function.  */
 
@@ -3520,6 +3478,7 @@ main (argc, argv, envp)
       flag_strength_reduce = 1;
       flag_rerun_cse_after_loop = 1;
       flag_caller_saves = 1;
+      flag_force_mem = 1;
 #ifdef INSN_SCHEDULING
       flag_schedule_insns = 1;
       flag_schedule_insns_after_reload = 1;
@@ -3531,6 +3490,11 @@ main (argc, argv, envp)
       flag_inline_functions = 1;
     }
 
+  /* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
+     modify it.  */
+  target_flags = 0;
+  set_target_switch ("");
+
 #ifdef OPTIMIZATION_OPTIONS
   /* Allow default optimizations to be specified on a per-machine basis.  */
   OPTIMIZATION_OPTIONS (optimize);
@@ -3539,9 +3503,6 @@ main (argc, argv, envp)
   /* Initialize register usage now so switches may override.  */
   init_reg_sets ();
 
-  target_flags = 0;
-  set_target_switch ("");
-
   for (i = 1; i < argc; i++)
     {
       int j;
@@ -3639,10 +3600,12 @@ main (argc, argv, envp)
                  case 'y':
                    set_yydebug (1);
                    break;
-
                  case 'x':
                    rtl_dump_and_exit = 1;
                    break;
+                 case 'A':
+                   flag_debug_asm = 1;
+                   break;
                  }
            }
          else if (str[0] == 'f')
@@ -3784,17 +3747,23 @@ main (argc, argv, envp)
            }
          else if (!strcmp (str, "p"))
            {
-             if (!output_bytecode)
-               profile_flag = 1;
-             else
-               error ("profiling not supported in bytecode compilation");
+             profile_flag = 1;
            }
          else if (!strcmp (str, "a"))
            {
 #if !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
              warning ("`-a' option (basic block profile) not supported");
 #else
-             profile_block_flag = 1;
+              profile_block_flag = (profile_block_flag < 2) ? 1 : 3;
+#endif
+           }
+         else if (!strcmp (str, "ax"))
+           {
+#if !defined (FUNCTION_BLOCK_PROFILER_EXIT) || !defined (BLOCK_PROFILER) || !defined (FUNCTION_BLOCK_PROFILER)
+             warning ("`-ax' option (jump profiling) not supported");
+#else
+             profile_block_flag = (!profile_block_flag 
+                                      || profile_block_flag == 2) ? 2 : 3;
 #endif
            }
          else if (str[0] == 'g')
@@ -3918,7 +3887,8 @@ You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
                use_gnu_debug_info_extensions = DEFAULT_GDB_EXTENSIONS;
 #endif       
              if (write_symbols == NO_DEBUG)
-               warning ("`-%s' option not supported on this version of GCC", str);
+               warning ("`-%s' not supported by this configuration of GCC",
+                        str);
              else if (level == 0)
                write_symbols = NO_DEBUG;
              else
@@ -3977,7 +3947,7 @@ You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
   if (write_symbols == DWARF_DEBUG
       && strcmp (language_string, "GNU C++") == 0)
     {
-      warning ("-g option not supported for C++ on SVR4 systems");
+      warning ("-g option not supported for C++ on systems using the DWARF debugging format");
       write_symbols = NO_DEBUG;
     }
 #endif /* defined(DWARF_DEBUGGING_INFO) */
@@ -3987,6 +3957,12 @@ You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
   OVERRIDE_OPTIONS;
 #endif
 
+  if (profile_block_flag == 3)
+    {
+      warning ("`-ax' and `-a' are conflicting options. `-a' ignored.");
+      profile_block_flag = 2;
+    }
+
   /* Unrolling all loops implies that standard loop unrolling must also
      be done.  */
   if (flag_unroll_all_loops)
@@ -4015,30 +3991,16 @@ You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
      option flags in use.  */
   if (version_flag)
     {
-      fprintf (stderr, "%s version %s", language_string, version_string);
-#ifdef TARGET_VERSION
-      TARGET_VERSION;
-#endif
-#ifdef __GNUC__
-#ifndef __VERSION__
-#define __VERSION__ "[unknown]"
-#endif
-      fprintf (stderr, " compiled by GNU C version %s.\n", __VERSION__);
-#else
-      fprintf (stderr, " compiled by CC.\n");
-#endif
+      print_version (stderr, "");
       if (! quiet_flag)
-       print_switch_values ();
+       print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
     }
 
   compile_file (filename);
 
-#if !defined(OS2) && !defined(VMS) && !defined(WINNT)
+#if !defined(OS2) && !defined(VMS) && !defined(_WIN32)
   if (flag_print_mem)
     {
-#ifdef __alpha
-      char *sbrk ();
-#endif
       char *lim = (char *) sbrk (0);
 
       fprintf (stderr, "Data size %d.\n",
@@ -4051,14 +4013,14 @@ You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
       system ("ps v");
 #endif /* not USG */
     }
-#endif /* not OS2 and not VMS and not WINNT */
+#endif /* not OS2 and not VMS and not _WIN32 */
 
   if (errorcount)
     exit (FATAL_EXIT_CODE);
   if (sorrycount)
     exit (FATAL_EXIT_CODE);
   exit (SUCCESS_EXIT_CODE);
-  return 34;
+  return 0;
 }
 \f
 /* Decode -m switches.  */
@@ -4115,51 +4077,128 @@ set_target_switch (name)
     error ("Invalid option `%s'", name);
 }
 \f
-/* Variable used for communication between the following two routines.  */
-
-static int line_position;
+/* Print version information to FILE.
+   Each line begins with INDENT (for the case where FILE is the
+   assembler output file).  */
 
-/* Print an option value and adjust the position in the line.  */
-
-static void
-print_single_switch (type, name)
-     char *type, *name;
+void
+print_version (file, indent)
+     FILE *file;
+     char *indent;
 {
-  fprintf (stderr, " %s%s", type, name);
+  fprintf (file, "%s%s%s version %s", indent, *indent != 0 ? " " : "",
+          language_string, version_string);
+  fprintf (file, " (%s)", TARGET_NAME);
+#ifdef __GNUC__
+#ifndef __VERSION__
+#define __VERSION__ "[unknown]"
+#endif
+  fprintf (file, " compiled by GNU C version %s.\n", __VERSION__);
+#else
+  fprintf (file, " compiled by CC.\n");
+#endif
+}
 
-  line_position += strlen (type) + strlen (name) + 1;
+/* Print an option value and return the adjusted position in the line.
+   ??? We don't handle error returns from fprintf (disk full).  */
 
-  if (line_position > 65)
+int
+print_single_switch (file, pos, max, indent, sep, term, type, name)
+     FILE *file;
+     int pos, max;
+     char *indent, *sep, *term, *type, *name;
+{
+  if (pos != 0
+      && pos + strlen (sep) + strlen (type) + strlen (name) > max)
+    {
+      fprintf (file, "%s", term);
+      pos = 0;
+    }
+  if (pos == 0)
     {
-      fprintf (stderr, "\n\t");
-      line_position = 8;
+      pos = fprintf (file, "%s", indent);
     }
+  pos += fprintf (file, "%s%s%s", sep, type, name);
+  return pos;
 }
      
-/* Print default target switches for -version.  */
+/* Print active target switches to FILE.
+   POS is the current cursor position and MAX is the size of a "line".
+   Each line begins with INDENT and ends with TERM.
+   Each switch is separated from the next by SEP.  */
 
-static void
-print_switch_values ()
+void
+print_switch_values (file, pos, max, indent, sep, term)
+     FILE *file;
+     int pos, max;
+     char *indent, *sep, *term;
 {
-  register int j;
+  int j, flags;
+  char **p;
+
+  /* Print the options as passed.  */
+
+  pos = print_single_switch (file, pos, max, indent, *indent ? " " : "", term,
+                            "options passed: ", "");
+
+  for (p = &save_argv[1]; *p != NULL; p++)
+    if (**p == '-')
+      {
+       /* Ignore these.  */
+       if (strcmp (*p, "-o") == 0)
+         {
+           if (p[1] != NULL)
+             p++;
+           continue;
+         }
+       if (strcmp (*p, "-quiet") == 0)
+         continue;
+       if (strcmp (*p, "-version") == 0)
+         continue;
+       if ((*p)[1] == 'd')
+         continue;
+
+       pos = print_single_switch (file, pos, max, indent, sep, term, *p, "");
+      }
+  if (pos > 0)
+    fprintf (file, "%s", term);
+
+  /* Print the -f and -m options that have been enabled.
+     We don't handle language specific options but printing argv
+     should suffice.  */
 
-  fprintf (stderr, "enabled:");
-  line_position = 8;
+  pos = print_single_switch (file, 0, max, indent, *indent ? " " : "", term,
+                            "options enabled: ", "");
 
   for (j = 0; j < sizeof f_options / sizeof f_options[0]; j++)
     if (*f_options[j].variable == f_options[j].on_value)
-      print_single_switch ("-f", f_options[j].string);
+      pos = print_single_switch (file, pos, max, indent, sep, term,
+                                "-f", f_options[j].string);
 
-  for (j = 0; j < sizeof W_options / sizeof W_options[0]; j++)
-    if (*W_options[j].variable == W_options[j].on_value)
-      print_single_switch ("-W", W_options[j].string);
+  /* Print target specific options.  */
 
+  flags = target_flags;
   for (j = 0; j < sizeof target_switches / sizeof target_switches[0]; j++)
     if (target_switches[j].name[0] != '\0'
        && target_switches[j].value > 0
        && ((target_switches[j].value & target_flags)
            == target_switches[j].value))
-      print_single_switch ("-m", target_switches[j].name);
+      {
+       pos = print_single_switch (file, pos, max, indent, sep, term,
+                                  "-m", target_switches[j].name);
+       flags &= ~ target_switches[j].value;
+      }
+
+#ifdef TARGET_OPTIONS
+  for (j = 0; j < sizeof target_options / sizeof target_options[0]; j++)
+    if (*target_options[j].variable != NULL)
+      {
+       char prefix[256];
+       sprintf (prefix, "-m%s", target_options[j].prefix);
+       pos = print_single_switch (file, pos, max, indent, sep, term,
+                                  prefix, *target_options[j].variable);
+      }
+#endif
 
-  fprintf (stderr, "\n");
+  fprintf (file, "%s", term);
 }