/* Command line option handling.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Neil Booth.
This file is part of GCC.
#include "diagnostic.h"
#include "tm_p.h" /* For OPTIMIZATION_OPTIONS. */
#include "insn-attr.h" /* For INSN_SCHEDULING. */
+#include "target.h"
/* Value of the -G xx switch, and whether it was passed or not. */
unsigned HOST_WIDE_INT g_switch_value;
/* Nonzero means warn about constructs which might not be
strict-aliasing safe. */
-bool warn_strict_aliasing;
+int warn_strict_aliasing;
/* True to warn if a switch on an enum, that does not have a default
case, fails to have a case for every enum value. */
if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE)))
{
- if (!(*lang_hooks.missing_argument) (opt, opt_index))
+ if (!lang_hooks.missing_argument (opt, opt_index))
error ("missing argument to \"%s\"", opt);
goto done;
}
}
if (option->flags & lang_mask)
- if ((*lang_hooks.handle_option) (opt_index, arg, value) == 0)
+ if (lang_hooks.handle_option (opt_index, arg, value) == 0)
result = 0;
if (result && (option->flags & CL_COMMON))
/* Interpret "-" or a non-switch as a file name. */
if (opt[0] != '-' || opt[1] == '\0')
{
- main_input_filename = opt;
+ if (main_input_filename == NULL)
+ main_input_filename = opt;
add_input_filename (opt);
n = 1;
continue;
unsigned int i, lang_mask;
/* Perform language-specific options initialization. */
- lang_mask = (*lang_hooks.init_options) (argc, argv);
+ lang_mask = lang_hooks.init_options (argc, argv);
lang_hooks.initialize_diagnostics (global_dc);
flag_guess_branch_prob = 1;
flag_cprop_registers = 1;
flag_loop_optimize = 1;
- flag_crossjumping = 1;
flag_if_conversion = 1;
flag_if_conversion2 = 1;
}
if (optimize >= 2)
{
+ flag_crossjumping = 1;
flag_optimize_sibling_calls = 1;
flag_cse_follow_jumps = 1;
flag_cse_skip_blocks = 1;
flag_rename_registers = 1;
flag_unswitch_loops = 1;
flag_web = 1;
+ flag_gcse_after_reload = 1;
}
if (optimize < 2 || optimize_size)
or less automatically remove extra jumps, but would also try to
use more short jumps instead of long jumps. */
flag_reorder_blocks = 0;
+ flag_reorder_blocks_and_partition = 0;
+ }
+
+ if (optimize_size)
+ {
+ /* Inlining of very small functions usually reduces total size. */
+ set_param_value ("max-inline-insns-single", 5);
+ set_param_value ("max-inline-insns-auto", 5);
+ set_param_value ("max-inline-insns-rtl", 10);
+ flag_inline_functions = 1;
}
/* Initialize whether `char' is signed. */
flag_signed_char = DEFAULT_SIGNED_CHAR;
-#ifdef DEFAULT_SHORT_ENUMS
/* Initialize how much space enums occupy, by default. */
- flag_short_enums = DEFAULT_SHORT_ENUMS;
-#endif
+ flag_short_enums = targetm.default_short_enums ();
/* Initialize target_flags before OPTIMIZATION_OPTIONS so the latter can
modify it. */
if (flag_really_no_inline == 2)
flag_really_no_inline = flag_no_inline;
+
+ /* The optimization to partition hot and cold basic blocks into separate
+ sections of the .o and executable files does not work (currently)
+ with exception handling. If flag_exceptions is turned on we need to
+ turn off the partitioning optimization. */
+
+ if (flag_exceptions && flag_reorder_blocks_and_partition)
+ {
+ warning
+ ("-freorder-blocks-and-partition does not work with exceptions");
+ flag_reorder_blocks_and_partition = 0;
+ flag_reorder_blocks = 1;
+ }
}
/* Handle target- and language-independent options. Return zero to
break;
case OPT_Wstrict_aliasing:
+ case OPT_Wstrict_aliasing_:
warn_strict_aliasing = value;
break;
flag_pie = value + value;
break;
+ case OPT_fabi_version_:
+ flag_abi_version = value;
+ break;
+
case OPT_falign_functions:
align_functions = !value;
break;
flag_branch_target_load_optimize2 = value;
break;
+ case OPT_fbtr_bb_exclusive:
+ flag_btr_bb_exclusive = value;
+ break;
+
case OPT_fcall_used_:
fix_register (arg, 0, 1);
break;
flag_gcse_sm = value;
break;
+ case OPT_fgcse_after_reload:
+ flag_gcse_after_reload = value;
+ break;
+
case OPT_fgcse_las:
flag_gcse_las = value;
break;
flag_reorder_blocks = value;
break;
+ case OPT_freorder_blocks_and_partition:
+ flag_reorder_blocks_and_partition = value;
+ break;
+
case OPT_freorder_functions:
flag_reorder_functions = value;
break;
flag_unwind_tables = value;
break;
+ case OPT_fvar_tracking:
+ flag_var_tracking = value;
+ break;
+
case OPT_fverbose_asm:
flag_verbose_asm = value;
break;
flag_wrapv = value;
break;
- case OPT_fwritable_strings:
- flag_writable_strings = value;
- break;
-
case OPT_fzero_initialized_in_bss:
flag_zero_initialized_in_bss = value;
break;