- register char *str = argv[i] + 1;
- if (str[0] == 'Y')
- str++;
-
- if (str[0] == 'm')
- set_target_switch (&str[1]);
- else if (!strcmp (str, "dumpbase"))
- {
- dump_base_name = argv[++i];
- }
- else if (str[0] == 'd')
- {
- register char *p = &str[1];
- while (*p)
- switch (*p++)
- {
- case 'a':
- branch_prob_dump = 1;
- combine_dump = 1;
-#ifdef DELAY_SLOTS
- dbr_sched_dump = 1;
-#endif
- flow_dump = 1;
- flow2_dump = 1;
- global_reg_dump = 1;
- jump_opt_dump = 1;
- addressof_dump = 1;
- jump2_opt_dump = 1;
- local_reg_dump = 1;
- loop_dump = 1;
- regmove_dump = 1;
- rtl_dump = 1;
- cse_dump = 1, cse2_dump = 1;
- gcse_dump = 1;
- sched_dump = 1;
- sched2_dump = 1;
-#ifdef STACK_REGS
- stack_reg_dump = 1;
-#endif
-#ifdef MACHINE_DEPENDENT_REORG
- mach_dep_reorg_dump = 1;
-#endif
- peephole2_dump = 1;
- break;
- case 'A':
- flag_debug_asm = 1;
- break;
- case 'b':
- branch_prob_dump = 1;
- break;
- case 'c':
- combine_dump = 1;
- break;
-#ifdef DELAY_SLOTS
- case 'd':
- dbr_sched_dump = 1;
- break;
-#endif
- case 'f':
- flow_dump = 1;
- break;
- case 'F':
- addressof_dump = 1;
- break;
- case 'g':
- global_reg_dump = 1;
- break;
- case 'G':
- gcse_dump = 1;
- break;
- case 'j':
- jump_opt_dump = 1;
- break;
- case 'J':
- jump2_opt_dump = 1;
- break;
-#ifdef STACK_REGS
- case 'k':
- stack_reg_dump = 1;
- break;
-#endif
- case 'l':
- local_reg_dump = 1;
- break;
- case 'L':
- loop_dump = 1;
- break;
- case 'm':
- flag_print_mem = 1;
- break;
-#ifdef MACHINE_DEPENDENT_REORG
- case 'M':
- mach_dep_reorg_dump = 1;
- break;
-#endif
- case 'p':
- flag_print_asm_name = 1;
- break;
- case 'r':
- rtl_dump = 1;
- break;
- case 'R':
- sched2_dump = 1;
- break;
- case 's':
- cse_dump = 1;
- break;
- case 'S':
- sched_dump = 1;
- break;
- case 't':
- cse2_dump = 1;
- break;
- case 'N':
- regmove_dump = 1;
- break;
- case 'v':
- graph_dump_format = vcg;
- break;
- case 'w':
- flow2_dump = 1;
- break;
- case 'x':
- rtl_dump_and_exit = 1;
- break;
- case 'y':
- set_yydebug (1);
- break;
- case 'z':
- peephole2_dump = 1;
- break;
- case 'D': /* these are handled by the preprocessor */
- case 'I':
- break;
- default:
- warning ("unrecognised gcc debugging option: %c", p[-1]);
- break;
- }
- }
- else if (str[0] == 'f')
- {
- register char *p = &str[1];
- int found = 0;
-
- /* Some kind of -f option.
- P's value is the option sans `-f'.
- Search for it in the table of options. */
-
- for (j = 0;
- !found && j < sizeof (f_options) / sizeof (f_options[0]);
- j++)
- {
- if (!strcmp (p, f_options[j].string))
- {
- *f_options[j].variable = f_options[j].on_value;
- /* A goto here would be cleaner,
- but breaks the vax pcc. */
- found = 1;
- }
- if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
- && ! strcmp (p+3, f_options[j].string))
- {
- *f_options[j].variable = ! f_options[j].on_value;
- found = 1;
- }
- }
-
- if (found)
- ;
- else if (!strncmp (p, "inline-limit-", 13)
- || !strncmp (p, "inline-limit=", 13))
- inline_max_insns =
- read_integral_parameter (p + 13, p - 2, inline_max_insns);
-#ifdef INSN_SCHEDULING
- else if (!strncmp (p, "sched-verbose=",14))
- fix_sched_param("verbose",&p[14]);
-#endif
- else if (!strncmp (p, "fixed-", 6))
- fix_register (&p[6], 1, 1);
- else if (!strncmp (p, "call-used-", 10))
- fix_register (&p[10], 0, 1);
- else if (!strncmp (p, "call-saved-", 11))
- fix_register (&p[11], 0, 0);
- else if (!strncmp (p, "align-loops=", 12))
- align_loops = read_integral_parameter (p + 12, p - 2,
- align_loops);
- else if (!strncmp (p, "align-functions=", 16))
- align_functions = read_integral_parameter (p + 16, p - 2,
- align_functions);
- else if (!strncmp (p, "align-jumps=", 12))
- align_jumps = read_integral_parameter (p + 12, p - 2,
- align_jumps);
- else if (!strncmp (p, "align-labels=", 13))
- align_labels = read_integral_parameter (p + 13, p - 2,
- align_labels);
- else
- error ("Invalid option `%s'", argv[i]);
- }
- else if (str[0] == 'O')
- {
- /* Already been treated above. Do nothing. */
- }
- else if (!strcmp (str, "pedantic"))
- pedantic = 1;
- else if (!strcmp (str, "pedantic-errors"))
- flag_pedantic_errors = pedantic = 1;
- else if (!strcmp (str, "quiet"))
- quiet_flag = 1;
- else if (!strcmp (str, "version"))
- version_flag = 1;
- else if (!strcmp (str, "w"))
- inhibit_warnings = 1;
- else if (!strcmp (str, "W"))
- {
- extra_warnings = 1;
- /* We save the value of warn_uninitialized, since if they put
- -Wuninitialized on the command line, we need to generate a
- warning about not using it without also specifying -O. */
- if (warn_uninitialized != 1)
- warn_uninitialized = 2;
- }
- else if (str[0] == 'W')
- {
- register char *p = &str[1];
- int found = 0;
-
- /* Some kind of -W option.
- P's value is the option sans `-W'.
- Search for it in the table of options. */
-
- for (j = 0;
- !found && j < sizeof (W_options) / sizeof (W_options[0]);
- j++)
- {
- if (!strcmp (p, W_options[j].string))
- {
- *W_options[j].variable = W_options[j].on_value;
- /* A goto here would be cleaner,
- but breaks the vax pcc. */
- found = 1;
- }
- if (p[0] == 'n' && p[1] == 'o' && p[2] == '-'
- && ! strcmp (p+3, W_options[j].string))
- {
- *W_options[j].variable = ! W_options[j].on_value;
- found = 1;
- }
- }
-
- if (found)
- ;
- else if (!strncmp (p, "id-clash-", 9))
- {
- const int id_clash_val
- = read_integral_parameter (p + 9, p - 2, -1);
- if (id_clash_val != -1)
- {
- id_clash_len = id_clash_val;
- warn_id_clash = 1;
- }
- }
- else if (!strncmp (p, "larger-than-", 12))
- {
- const int larger_than_val
- = read_integral_parameter (p + 12, p - 2, -1);
- if (larger_than_val != -1)
- {
- larger_than_size = larger_than_val;
- warn_larger_than = 1;
- }
- }
- else
- error ("Invalid option `%s'", argv[i]);
- }
- else if (!strcmp (str, "p"))
- {
- 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 = (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')
- {
- unsigned level;
- /* A lot of code assumes write_symbols == NO_DEBUG if the
- debugging level is 0 (thus -gstabs1 -gstabs0 would lose track
- of what debugging type has been selected). This records the
- selected type. It is an error to specify more than one
- debugging type. */
- static enum debug_info_type selected_debug_type = NO_DEBUG;
- /* Non-zero if debugging format has been explicitly set.
- -g and -ggdb don't explicitly set the debugging format so
- -gdwarf -g3 is equivalent to -gdwarf3. */
- static int type_explicitly_set_p = 0;
- /* Indexed by enum debug_info_type. */
- static const char *debug_type_names[] =
- {
- "none", "stabs", "coff", "dwarf-1", "dwarf-2", "xcoff"
- };
-
- /* The maximum admissible debug level value. */
- static const unsigned max_debug_level = 3;
-
- /* Look up STR in the table. */
- for (da = debug_args; da->arg; da++)
- {
- const int da_len = strlen (da->arg);
-
- if (! strncmp (str, da->arg, da_len))
- {
- enum debug_info_type type = da->debug_type;
- const char *p = str + da_len;
-
- if (*p && (*p < '0' || *p > '9'))
- continue;
-
- /* A debug flag without a level defaults to level 2.
- Note we do not want to call read_integral_parameter
- for that case since it will call atoi which
- will return zero.
-
- ??? We may want to generalize the interface to
- read_integral_parameter to better handle this case
- if this case shows up often. */
- if (*p)
- level = read_integral_parameter (p, 0,
- max_debug_level + 1);
- else
- level = 2;
-
- if (da_len > 1 && *p && !strncmp (str, "gdwarf", da_len))
- {
- error ("use -gdwarf -g%d for DWARF v1, level %d",
- level, level);
- if (level == 2)
- error ("use -gdwarf-2 for DWARF v2");
- }
-
- if (level > max_debug_level)
- {
- warning ("ignoring option `%s' due to invalid debug level specification",
- str - 1);
- level = debug_info_level;
- }
-
- if (type == NO_DEBUG)
- {
- type = PREFERRED_DEBUGGING_TYPE;
- if (da_len > 1 && strncmp (str, "ggdb", da_len) == 0)
- {
-#if defined (DWARF2_DEBUGGING_INFO) && !defined (LINKER_DOES_NOT_WORK_WITH_DWARF2)
- type = DWARF2_DEBUG;
-#else
-#ifdef DBX_DEBUGGING_INFO
- type = DBX_DEBUG;
-#endif
-#endif
- }
- }
-
- if (type == NO_DEBUG)
- warning ("`-%s' not supported by this configuration of GCC",
- str);
-
- /* Does it conflict with an already selected type? */
- if (type_explicitly_set_p
- /* -g/-ggdb don't conflict with anything */
- && da->debug_type != NO_DEBUG
- && type != selected_debug_type)
- warning ("`-%s' ignored, conflicts with `-g%s'",
- str, debug_type_names[(int) selected_debug_type]);
- else
- {
- /* If the format has already been set, -g/-ggdb
- only change the debug level. */
- if (type_explicitly_set_p
- && da->debug_type == NO_DEBUG)
- ; /* don't change debugging type */
- else
- {
- selected_debug_type = type;
- type_explicitly_set_p = da->debug_type != NO_DEBUG;
- }
- write_symbols = (level == 0
- ? NO_DEBUG
- : selected_debug_type);
- use_gnu_debug_info_extensions = da->use_extensions_p;
- debug_info_level = (enum debug_info_level) level;
- }
- break;
- }
- }
- if (! da->arg)
- warning ("`-%s' not supported by this configuration of GCC",
- str);
- }
- else if (!strcmp (str, "o"))
- {
- asm_file_name = argv[++i];
- }
- else if (str[0] == 'G')
- {
- const int g_switch_val = (str[1] != '\0') ?
- read_integral_parameter(str + 1, 0, -1) :
- read_integral_parameter(argv[++i], 0, -1);
-
- if (g_switch_val != -1)
- {
- g_switch_set = TRUE;
- g_switch_value = g_switch_val;
- }
- else
- {
- error("Invalid option `-%s'",str);
- }
- }
- else if (!strncmp (str, "aux-info", 8))
- {
- flag_gen_aux_info = 1;
- aux_info_file_name = (str[8] != '\0' ? str+8 : argv[++i]);
- }
- else if (!strcmp (str, "-help"))
- {
- display_help ();
- return (0);
- }
- else
- error ("Invalid option `%s'", argv[i]);