/* Top level of GNU C compiler
- Copyright (C) 1987, 1988, 1989, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU CC.
#include "rtl.h"
#include "flags.h"
#include "insn-attr.h"
+#include "defaults.h"
#ifdef XCOFF_DEBUGGING_INFO
#include "xcoffout.h"
struct rtx_def *(*lang_expand_expr) ();
+/* Pointer to function to finish handling an incomplete decl at the
+ end of compilation. */
+
+void (*incomplete_decl_finalize_hook) () = 0;
+
/* Nonzero if generating code to do profiling. */
int profile_flag = 0;
int flag_caller_saves = 0;
#endif
+/* Nonzero if structures and unions should be returned in memory.
+
+ This should only be defined if compatibility with another compiler or
+ with an ABI is needed, because it results in slower code. */
+
+#ifndef DEFAULT_PCC_STRUCT_RETURN
+#define DEFAULT_PCC_STRUCT_RETURN 1
+#endif
+
/* Nonzero for -fpcc-struct-return: return values the same way PCC does. */
-int flag_pcc_struct_return = 0;
+int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
/* Nonzero for -fforce-mem: load memory value into a register
before arithmetic on it. This makes better cse but slower compilation. */
/* Nonzero for -fdefer-pop: don't pop args after each function call;
instead save them up to pop many calls' args with one insns. */
-int flag_defer_pop = 1;
+int flag_defer_pop = 0;
/* Nonzero for -ffloat-store: don't allocate floats and doubles
in extended-precision registers. */
int flag_volatile;
+/* Nonzero means treat all global and extern variables as global. */
+
+int flag_volatile_global;
+
/* Nonzero means just do syntax checking; don't output anything. */
int flag_syntax_only = 0;
{
{"float-store", &flag_float_store, 1},
{"volatile", &flag_volatile, 1},
+ {"volatile-global", &flag_volatile_global, 1},
{"defer-pop", &flag_defer_pop, 1},
{"omit-frame-pointer", &flag_omit_frame_pointer, 1},
{"cse-follow-jumps", &flag_cse_follow_jumps, 1},
{"shared-data", &flag_shared_data, 1},
{"caller-saves", &flag_caller_saves, 1},
{"pcc-struct-return", &flag_pcc_struct_return, 1},
+ {"reg-struct-return", &flag_pcc_struct_return, 0},
{"delayed-branch", &flag_delayed_branch, 1},
{"rerun-cse-after-loop", &flag_rerun_cse_after_loop, 1},
{"pretend-float", &flag_pretend_float, 1},
"-fno-builtin",
"-fno-ident",
"-fident",
+ "-fdollars-in-identifiers",
+ "-fnodollars-in-identifiers",
"-ansi",
"-Wimplicit",
"-Wno-implicit",
"-Wno-trigraphs",
"-Wimport",
"-Wno-import",
+ "-Wmissing-braces",
+ "-Wno-missing-braces",
"-Wall",
/* These are for C++. */
"-fno-xref",
"-fnonnull-objects",
"-fno-nonnull-objects",
+ "-fimplement-inlines",
+ "-fno-implement-inlines",
+ "-fexternal-templates",
+ "-fno-external-templates",
"-Wreturn-type",
"-Wno-return-type",
"-Wno-enum-clash",
"-Wtemplate-debugging",
"-Wno-template-debugging",
+ "-Wctor-dtor-privacy",
+ "-Wno-ctor-dtor-privacy",
/* these are for obj c */
"-lang-objc",
"-gen-decls",
+ "-fgnu-runtime",
+ "-fno-gnu-runtime",
+ "-fnext-runtime",
+ "-fno-next-runtime",
"-Wselector",
"-Wno-selector",
+ "-Wprotocol",
+ "-Wno-protocol",
0
};
\f
{
fprintf (stderr, " from %s:%d", p->name, p->line);
if (p->next)
- fprintf (stderr, ",");
+ fprintf (stderr, ",\n ");
}
fprintf (stderr, ":\n");
last_error_tick = input_file_stack_tick;
name[len - 2] = 0;
else if (len > 4 && ! strcmp (".ada", name + len - 4))
name[len - 4] = 0;
+ else if (len > 4 && ! strcmp (".atr", name + len - 4))
+ name[len - 4] = 0;
}
/* Output a file name in the form wanted by System V. */
#endif
}
\f
+/* Routine to build language identifier for object file. */
+static void
+output_lang_identify (asm_out_file)
+ FILE *asm_out_file;
+{
+ int len = strlen (lang_identify ()) + sizeof ("__gnu_compiled_") + 1;
+ char *s = (char *) alloca (len);
+ sprintf (s, "__gnu_compiled_%s", lang_identify ());
+ ASM_OUTPUT_LABEL (asm_out_file, s);
+}
+
/* Compile an entire file of output from cpp, named NAME.
Write a file of assembly output and various debugging dumps. */
#else
ASM_IDENTIFY_GCC (asm_out_file);
#endif
+
+ /* Output something to identify which front-end produced this file. */
+#ifdef ASM_IDENTIFY_LANGUAGE
+ ASM_IDENTIFY_LANGUAGE (asm_out_file);
+#endif
+
+/* ??? Note: There used to be a conditional here
+ to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
+ This was to guarantee separation between gcc_compiled. and
+ the first function, for the sake of dbx on Suns.
+ However, having the extra zero here confused the Emacs
+ code for unexec, and might confuse other programs too.
+ Therefore, I took out that change.
+ In future versions we should find another way to solve
+ that dbx problem. -- rms, 23 May 93. */
+
/* Don't let the first function fall at the same address
as gcc_compiled., if profiling. */
if (profile_flag || profile_block_flag)
for (i = 0; i < len; i++)
{
decl = vec[i];
+ if (TREE_CODE (decl) == VAR_DECL && DECL_SIZE (decl) == 0
+ && incomplete_decl_finalize_hook != 0)
+ (*incomplete_decl_finalize_hook) (decl);
+
if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)
&& ! TREE_ASM_WRITTEN (decl))
{
&& (TREE_ADDRESSABLE (decl)
|| TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (decl)))
&& ! DECL_EXTERNAL (decl))
- output_inline_function (decl);
+ {
+ temporary_allocation ();
+ output_inline_function (decl);
+ permanent_allocation ();
+ }
/* Warn about any function
declared static but not defined.
&& DECL_INITIAL (decl) == 0
&& DECL_EXTERNAL (decl)
&& ! TREE_PUBLIC (decl))
- warning_with_decl (decl, "`%s' declared `static' but never defined");
+ {
+ /* This should be a pedwarn, except that there is
+ no easy way to prevent it from happening when the
+ name is used only inside a sizeof.
+ This at least avoids being incorrect. */
+ warning_with_decl (decl,
+ "`%s' declared `static' but never defined");
+ /* This symbol is effectively an "extern" declaration now. */
+ TREE_PUBLIC (decl) = 1;
+ assemble_external (decl);
+
+ }
/* Warn about static fns or vars defined but not used,
but not about inline functions
since unused inline statics is normal practice. */
signal (SIGFPE, float_signal);
+#ifdef SIGPIPE
signal (SIGPIPE, pipe_closed);
+#endif
decl_printable_name = decl_name;
lang_expand_expr = (struct rtx_def *(*)()) do_abort;
if (optimize >= 1)
{
+ flag_defer_pop = 1;
flag_thread_jumps = 1;
#ifdef DELAY_SLOTS
flag_delayed_branch = 1;
warning ("-Wuninitialized is not supported without -O");
}
+#if defined(DWARF_DEBUGGING_INFO)
+ if (write_symbols == DWARF_DEBUG
+ && strcmp (language_string, "GNU C++") == 0)
+ {
+ warning ("-g option not supported for C++ on SVR4 systems");
+ write_symbols = NO_DEBUG;
+ }
+#endif /* defined(DWARF_DEBUGGING_INFO) */
+
#ifdef OVERRIDE_OPTIONS
/* Some machines may reject certain combinations of options. */
OVERRIDE_OPTIONS;