Error messages and low-level interface to malloc also handled here. */
#include "config.h"
-#undef FLOAT /* This is for hpux. They should change hpux. */
-#undef FFS /* Some systems define this in param.h. */
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "line-map.h"
#include "input.h"
#include "tree.h"
+#include "realmpfr.h" /* For GMP/MPFR/MPC versions, in print_version. */
#include "version.h"
#include "rtl.h"
#include "tm_p.h"
#include "regs.h"
#include "timevar.h"
#include "diagnostic.h"
+#include "tree-diagnostic.h"
+#include "tree-pretty-print.h"
#include "params.h"
#include "reload.h"
#include "ira.h"
#include "dwarf2asm.h"
#include "integrate.h"
-#include "real.h"
#include "debug.h"
#include "target.h"
#include "langhooks.h"
#include "gimple.h"
#include "tree-ssa-alias.h"
#include "plugin.h"
+#include "varray.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
const char *main_input_filename;
/* Used to enable -fvar-tracking, -fweb and -frename-registers according
- to optimize and default_debug_hooks in process_options (). */
+ to optimize in process_options (). */
#define AUTODETECT_VALUE 2
/* Current position in real source file. */
const struct gcc_debug_hooks *debug_hooks;
-/* Debug hooks - target default. */
-
-static const struct gcc_debug_hooks *default_debug_hooks;
-
/* Other flags saying which kinds of debugging dump have been requested. */
int rtl_dump_and_exit;
what's left of the symbol table output. */
timevar_pop (TV_PARSE);
- if (flag_syntax_only)
+ if (flag_syntax_only || flag_wpa)
return;
ggc_protect_identifiers = false;
/* Write out any pending weak symbol declarations. */
weak_finish ();
+ /* This must be at the end before unwind and debug info.
+ Some target ports emit PIC setup thunks here. */
+ targetm.asm_out.code_end ();
+
/* Do dbx symbols. */
timevar_push (TV_SYMOUT);
most targets, but completely right for very few. */
void *
-default_get_pch_validity (size_t *len)
+default_get_pch_validity (size_t *sz)
{
struct cl_option_state state;
size_t i;
char *result, *r;
- *len = 2;
+ *sz = 2;
if (targetm.check_pch_target_flags)
- *len += sizeof (target_flags);
+ *sz += sizeof (target_flags);
for (i = 0; i < cl_options_count; i++)
if (option_affects_pch_p (i, &state))
- *len += state.size;
+ *sz += state.size;
- result = r = XNEWVEC (char, *len);
+ result = r = XNEWVEC (char, *sz);
r[0] = flag_pic;
r[1] = flag_pie;
r += 2;
t = va_arg (*text->args_ptr, tree);
break;
+ case 'K':
+ percent_K_format (text);
+ return true;
+
default:
return false;
}
/* Initialize the diagnostics reporting machinery, so option parsing
can give warnings and errors. */
diagnostic_initialize (global_dc);
+ diagnostic_starter (global_dc) = default_tree_diagnostic_starter;
/* Set a default printer. Language specific initializations will
override it later. */
pp_format_decoder (global_dc->printer) = &default_tree_printer;
+ global_dc->show_option_requested = flag_diagnostics_show_option;
/* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages. */
#ifdef SIGSEGV
warn_unused_parameter = (warn_unused && extra_warnings);
if (warn_unused_variable == -1)
warn_unused_variable = warn_unused;
+ /* Wunused-but-set-parameter is enabled if both -Wunused -Wextra are
+ enabled. */
+ if (warn_unused_but_set_parameter == -1)
+ warn_unused_but_set_parameter = (warn_unused && extra_warnings);
+ if (warn_unused_but_set_variable == -1)
+ warn_unused_but_set_variable = warn_unused;
if (warn_unused_value == -1)
warn_unused_value = warn_unused;
OVERRIDE_OPTIONS;
#endif
+ /* Avoid any informative notes in the second run of -fcompare-debug. */
+ if (flag_compare_debug)
+ diagnostic_inhibit_notes (global_dc);
+
if (flag_section_anchors && !target_supports_section_anchors_p ())
{
warning (OPT_fsection_anchors,
if (debug_info_level == DINFO_LEVEL_NONE)
write_symbols = NO_DEBUG;
- /* Now we know write_symbols, set up the debug hooks based on it.
- By default we do nothing for debug output. */
- if (PREFERRED_DEBUGGING_TYPE == NO_DEBUG)
- default_debug_hooks = &do_nothing_debug_hooks;
-#if defined(DBX_DEBUGGING_INFO)
- else if (PREFERRED_DEBUGGING_TYPE == DBX_DEBUG)
- default_debug_hooks = &dbx_debug_hooks;
-#endif
-#if defined(XCOFF_DEBUGGING_INFO)
- else if (PREFERRED_DEBUGGING_TYPE == XCOFF_DEBUG)
- default_debug_hooks = &xcoff_debug_hooks;
-#endif
-#ifdef SDB_DEBUGGING_INFO
- else if (PREFERRED_DEBUGGING_TYPE == SDB_DEBUG)
- default_debug_hooks = &sdb_debug_hooks;
-#endif
-#ifdef DWARF2_DEBUGGING_INFO
- else if (PREFERRED_DEBUGGING_TYPE == DWARF2_DEBUG)
- default_debug_hooks = &dwarf2_debug_hooks;
-#endif
-#ifdef VMS_DEBUGGING_INFO
- else if (PREFERRED_DEBUGGING_TYPE == VMS_DEBUG
- || PREFERRED_DEBUGGING_TYPE == VMS_AND_DWARF2_DEBUG)
- default_debug_hooks = &vmsdbg_debug_hooks;
-#endif
-
if (write_symbols == NO_DEBUG)
;
#if defined(DBX_DEBUGGING_INFO)
"for correctness");
flag_omit_frame_pointer = 0;
}
+
+ /* Save the current optimization options. */
+ optimization_default_node = build_optimization_node ();
+ optimization_current_node = optimization_default_node;
}
/* This function can be called multiple times to reinitialize the compiler
/* We may need to recompute regno_save_code[] and regno_restore_code[]
after a mode change as well. */
- if (flag_caller_saves)
- init_caller_save ();
+ caller_save_initialized_p = false;
+
expand_dummy_function_end ();
}
dump_tree_statistics ();
dump_gimple_statistics ();
dump_rtx_statistics ();
- dump_varray_statistics ();
dump_alloc_pool_statistics ();
dump_bitmap_statistics ();
dump_vec_loc_statistics ();
if (warningcount || errorcount)
print_ignored_options ();
+ diagnostic_finish (global_dc);
/* Invoke registered plugin callbacks if any. */
invoke_plugin_callbacks (PLUGIN_FINISH, NULL);