From e3339d0f3328e3bae21e460dde81ba4bdcfcd959 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 29 Sep 2010 15:49:14 +0100 Subject: [PATCH] optc-gen.awk: Generate global_options initializer instead of individual variables. gcc: * optc-gen.awk: Generate global_options initializer instead of individual variables. Add x_ prefix to names of structure members. * opth-gen.awk: Generate gcc_options structure. Add x_ prefix to names of structure members. * doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Document. * doc/tm.texi: Regenerate. * alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. * c-parser.c (disable_extension_diagnostics, restore_extension_diagnostics): Update names of cpp_options members. * combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * common.opt (fcompare-debug-second): Don't use Var. * config/alpha/alpha.h (target_flags): Remove. * config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define. * config/bfin/bfin.h (target_flags): Remove. * config/cris/cris.h (target_flags): Remove. * config/i386/i386-c.c (ix86_pragma_target_parse): Update names of cl_target_option members. * config/i386/i386.c (ix86_force_align_arg_pointer): Remove. (ix86_function_specific_print, ix86_valid_target_attribute_tree, ix86_can_inline_p): Update names of cl_target_option members. * config/i386/i386.h (ix86_isa_flags): Remove. * config/lm32/lm32.h (target_flags): Remove. * config/mcore/mcore.h (mcore_stack_increment): Remove. * config/mcore/mcore.md (addsi3): Remove extern declaration of flag_omit_frame_pointer. * config/mep/mep.h (target_flags): Remove. * config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define. * config/mmix/mmix.h (target_flags): Remove. * config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic, flag_expensive_optimizations): Remove. * config/s390/s390.h (flag_pic): Remove. * config/score/score-conv.h (target_flags): Remove. * config/sh/sh.h (sh_fixed_range_str): Remove. * config/spu/spu.h (target_flags, spu_fixed_range_string): Remove. * dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER * df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * diagnostic.c (diagnostic_initialize): Update names of diagnostic_context members. * diagnostic.h (diagnostic_context): Rename inhibit_warnings and warn_system_headers. (diagnostic_report_warnings_p): Update for new names. * dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER * emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and HARD_FRAME_POINTER_IS_ARG_POINTER. * flags.h (flag_compare_debug): Declare. * ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * opts.c (flag_compare_debug): Define. (common_handle_option): Update names of diagnostic_context members. Handle -fcompare-debug-second. (fast_math_flags_struct_set_p): Update names of cl_optimization members. * reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. * rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use. * sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER * stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. gcc/c-family: * c-common.c (c_cpp_error): Update names of diagnostic_context members. * c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of cl_optimization members. * c-opts.c (warning_as_error_callback, c_common_handle_option, sanitize_cpp_opts, finish_options): Update names of cpp_options members. gcc/fortran: * cpp.c (cpp_define_builtins): Update names of gfc_option_t members. (gfc_cpp_post_options): Update names of cpp_options members. (cb_cpp_error): Update names of diagnostic_context members. * f95-lang.c (gfc_init_builtin_functions): Update names of gfc_option_t members. * gfortran.h (gfc_option_t): Rename warn_conversion and flag_openmp. * intrinsic.c (gfc_convert_type_warn): Update names of gfc_option_t members. * options.c (gfc_init_options, gfc_post_options, set_Wall, gfc_handle_option): Update names of gfc_option_t members. * parse.c (next_free, next_fixed): Update names of gfc_option_t members. * scanner.c (pedantic): Remove extern declaration. (skip_free_comments, skip_fixed_comments, include_line): Update names of gfc_option_t members. * trans-decl.c (gfc_generate_function_code): Update names of gfc_option_t members. gcc/java: * java-tree.h (flag_filelist_file, flag_assert, flag_jni, flag_force_classes_archive_check, flag_redundant, flag_newer, flag_use_divide_subroutine, flag_use_atomic_builtins, flag_use_boehm_gc, flag_hash_synchronization, flag_check_references, flag_optimize_sci, flag_indirect_classes, flag_indirect_dispatch, flag_store_check, flag_reduced_reflection): Remove. * jcf-dump.c (flag_newer): Remove. * jcf.h (quiet_flag): Remove. * parse.h (quiet_flag): Remove. libcpp: * include/cpplib.h (cpp_options): Rename warn_deprecated, warn_traditional, warn_long_long and pedantic. * directives.c (directive_diagnostics, _cpp_handle_directive): Update names of cpp_options members. * expr.c (cpp_classify_number, eval_token): Update names of cpp_options members. * init.c (cpp_create_reader, post_options): Update names of cpp_options members. * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of cpp_options members. * macro.c (parse_params): Update names of cpp_options members. From-SVN: r164723 --- gcc/ChangeLog | 69 +++++++++++++++++++++ gcc/alias.c | 2 +- gcc/builtins.c | 2 +- gcc/c-family/ChangeLog | 10 ++++ gcc/c-family/c-common.c | 6 +- gcc/c-family/c-cppbuiltin.c | 16 ++--- gcc/c-family/c-opts.c | 16 ++--- gcc/c-parser.c | 12 ++-- gcc/combine.c | 6 +- gcc/common.opt | 2 +- gcc/config/alpha/alpha.h | 2 - gcc/config/arm/arm.h | 3 + gcc/config/bfin/bfin.h | 4 -- gcc/config/cris/cris.h | 3 - gcc/config/i386/i386-c.c | 6 +- gcc/config/i386/i386.c | 13 ++-- gcc/config/i386/i386.h | 2 - gcc/config/lm32/lm32.h | 2 - gcc/config/mcore/mcore.h | 1 - gcc/config/mcore/mcore.md | 4 +- gcc/config/mep/mep.h | 2 - gcc/config/mips/mips.h | 3 + gcc/config/mmix/mmix.h | 2 - gcc/config/rs6000/rs6000.h | 3 - gcc/config/s390/s390.h | 2 - gcc/config/score/score-conv.h | 4 +- gcc/config/sh/sh.h | 2 - gcc/config/spu/spu.h | 3 - gcc/dbxout.c | 4 +- gcc/df-scan.c | 10 ++-- gcc/diagnostic.c | 4 +- gcc/diagnostic.h | 8 +-- gcc/doc/tm.texi | 16 +++++ gcc/doc/tm.texi.in | 16 +++++ gcc/dwarf2out.c | 2 +- gcc/emit-rtl.c | 4 +- gcc/flags.h | 5 ++ gcc/fortran/ChangeLog | 22 +++++++ gcc/fortran/cpp.c | 10 ++-- gcc/fortran/f95-lang.c | 2 +- gcc/fortran/gfortran.h | 4 +- gcc/fortran/intrinsic.c | 6 +- gcc/fortran/options.c | 16 ++--- gcc/fortran/parse.c | 4 +- gcc/fortran/scanner.c | 12 ++-- gcc/fortran/trans-decl.c | 2 +- gcc/ira.c | 2 +- gcc/java/ChangeLog | 13 ++++ gcc/java/java-tree.h | 53 ---------------- gcc/java/jcf-dump.c | 4 -- gcc/java/jcf.h | 3 +- gcc/java/parse.h | 3 +- gcc/optc-gen.awk | 110 ++++++++++++++++++++-------------- gcc/opth-gen.awk | 48 +++++++++++---- gcc/opts.c | 23 ++++--- gcc/reginfo.c | 4 +- gcc/regrename.c | 4 +- gcc/reload.c | 4 +- gcc/reload1.c | 4 +- gcc/resource.c | 6 +- gcc/rtl.h | 14 ++++- gcc/sel-sched.c | 4 +- gcc/stmt.c | 2 +- libcpp/ChangeLog | 14 +++++ libcpp/directives.c | 4 +- libcpp/expr.c | 6 +- libcpp/include/cpplib.h | 8 +-- libcpp/init.c | 6 +- libcpp/internal.h | 6 +- libcpp/macro.c | 6 +- 70 files changed, 419 insertions(+), 281 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62bb6f6b7e9..bcfabb636ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,72 @@ +2010-09-29 Joseph Myers + + * optc-gen.awk: Generate global_options initializer instead of + individual variables. Add x_ prefix to names of structure + members. + * opth-gen.awk: Generate gcc_options structure. Add x_ prefix to + names of structure members. + * doc/tm.texi.in (HARD_FRAME_POINTER_IS_FRAME_POINTER, + HARD_FRAME_POINTER_IS_ARG_POINTER): Document. + * doc/tm.texi: Regenerate. + * alias.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER + * builtins.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. + * c-parser.c (disable_extension_diagnostics, + restore_extension_diagnostics): Update names of cpp_options + members. + * combine.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER + * common.opt (fcompare-debug-second): Don't use Var. + * config/alpha/alpha.h (target_flags): Remove. + * config/arm/arm.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, + HARD_FRAME_POINTER_IS_ARG_POINTER): Define. + * config/bfin/bfin.h (target_flags): Remove. + * config/cris/cris.h (target_flags): Remove. + * config/i386/i386-c.c (ix86_pragma_target_parse): Update names of + cl_target_option members. + * config/i386/i386.c (ix86_force_align_arg_pointer): Remove. + (ix86_function_specific_print, ix86_valid_target_attribute_tree, + ix86_can_inline_p): Update names of cl_target_option members. + * config/i386/i386.h (ix86_isa_flags): Remove. + * config/lm32/lm32.h (target_flags): Remove. + * config/mcore/mcore.h (mcore_stack_increment): Remove. + * config/mcore/mcore.md (addsi3): Remove extern declaration of + flag_omit_frame_pointer. + * config/mep/mep.h (target_flags): Remove. + * config/mips/mips.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, + HARD_FRAME_POINTER_IS_ARG_POINTER): Define. + * config/mmix/mmix.h (target_flags): Remove. + * config/rs6000/rs6000.h (rs6000_xilinx_fpu, flag_pic, + flag_expensive_optimizations): Remove. + * config/s390/s390.h (flag_pic): Remove. + * config/score/score-conv.h (target_flags): Remove. + * config/sh/sh.h (sh_fixed_range_str): Remove. + * config/spu/spu.h (target_flags, spu_fixed_range_string): Remove. + * dbxout.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER + * df-scan.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. + * diagnostic.c (diagnostic_initialize): Update names of + diagnostic_context members. + * diagnostic.h (diagnostic_context): Rename inhibit_warnings and + warn_system_headers. + (diagnostic_report_warnings_p): Update for new names. + * dwarf2out.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER + * emit-rtl.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER and + HARD_FRAME_POINTER_IS_ARG_POINTER. + * flags.h (flag_compare_debug): Declare. + * ira.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER + * opts.c (flag_compare_debug): Define. + (common_handle_option): Update names of diagnostic_context + members. Handle -fcompare-debug-second. + (fast_math_flags_struct_set_p): Update names of cl_optimization + members. + * reginfo.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. + * regrename.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. + * reload.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. + * reload1.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. + * resource.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER. + * rtl.h (HARD_FRAME_POINTER_IS_FRAME_POINTER, + HARD_FRAME_POINTER_IS_ARG_POINTER): Define and use. + * sel-sched.c: Use HARD_FRAME_POINTER_IS_FRAME_POINTER + * stmt.c: Use HARD_FRAME_POINTER_IS_ARG_POINTER. + 2010-09-29 Hariharan Sandanagobalane * config/picochip/picochip.c (picochip_output_internal_label): diff --git a/gcc/alias.c b/gcc/alias.c index 854ac27aa9d..298f39b5434 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2688,7 +2688,7 @@ init_alias_target (void) = gen_rtx_ADDRESS (Pmode, arg_pointer_rtx); static_reg_base_value[FRAME_POINTER_REGNUM] = gen_rtx_ADDRESS (Pmode, frame_pointer_rtx); -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER static_reg_base_value[HARD_FRAME_POINTER_REGNUM] = gen_rtx_ADDRESS (Pmode, hard_frame_pointer_rtx); #endif diff --git a/gcc/builtins.c b/gcc/builtins.c index 384a81a035b..4c3b1ae76a4 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -835,7 +835,7 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED) emit_clobber (hard_frame_pointer_rtx); } -#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_ARG_POINTER if (fixed_regs[ARG_POINTER_REGNUM]) { #ifdef ELIMINABLE_REGS diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 716957381e3..41b585f3729 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,13 @@ +2010-09-29 Joseph Myers + + * c-common.c (c_cpp_error): Update names of diagnostic_context + members. + * c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Update names of + cl_optimization members. + * c-opts.c (warning_as_error_callback, c_common_handle_option, + sanitize_cpp_opts, finish_options): Update names of cpp_options + members. + 2010-09-29 Nicola Pero * c-common.h (OBJC_IS_CXX_KEYWORD): New macro. Updated comments. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 1573d488171..950573b64af 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -8311,7 +8311,7 @@ c_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason, { diagnostic_info diagnostic; diagnostic_t dlevel; - bool save_warn_system_headers = global_dc->warn_system_headers; + bool save_warn_system_headers = global_dc->dc_warn_system_headers; bool ret; switch (level) @@ -8319,7 +8319,7 @@ c_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason, case CPP_DL_WARNING_SYSHDR: if (flag_no_output) return false; - global_dc->warn_system_headers = 1; + global_dc->dc_warn_system_headers = 1; /* Fall through. */ case CPP_DL_WARNING: if (flag_no_output) @@ -8356,7 +8356,7 @@ c_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason, c_option_controlling_cpp_error (reason)); ret = report_diagnostic (&diagnostic); if (level == CPP_DL_WARNING_SYSHDR) - global_dc->warn_system_headers = save_warn_system_headers; + global_dc->dc_warn_system_headers = save_warn_system_headers; return ret; } diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 86e45209b47..7fe299308e4 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -514,14 +514,14 @@ c_cpp_builtins_optimize_pragma (cpp_reader *pfile, tree prev_tree, /* Other target-independent built-ins determined by command-line options. */ - if (!prev->optimize_size && cur->optimize_size) + if (!prev->x_optimize_size && cur->x_optimize_size) cpp_define (pfile, "__OPTIMIZE_SIZE__"); - else if (prev->optimize_size && !cur->optimize_size) + else if (prev->x_optimize_size && !cur->x_optimize_size) cpp_undef (pfile, "__OPTIMIZE_SIZE__"); - if (!prev->optimize && cur->optimize) + if (!prev->x_optimize && cur->x_optimize) cpp_define (pfile, "__OPTIMIZE__"); - else if (prev->optimize && !cur->optimize) + else if (prev->x_optimize && !cur->x_optimize) cpp_undef (pfile, "__OPTIMIZE__"); prev_fast_math = fast_math_flags_struct_set_p (prev); @@ -531,17 +531,17 @@ c_cpp_builtins_optimize_pragma (cpp_reader *pfile, tree prev_tree, else if (prev_fast_math && !cur_fast_math) cpp_undef (pfile, "__FAST_MATH__"); - if (!prev->flag_signaling_nans && cur->flag_signaling_nans) + if (!prev->x_flag_signaling_nans && cur->x_flag_signaling_nans) cpp_define (pfile, "__SUPPORT_SNAN__"); - else if (prev->flag_signaling_nans && !cur->flag_signaling_nans) + else if (prev->x_flag_signaling_nans && !cur->x_flag_signaling_nans) cpp_undef (pfile, "__SUPPORT_SNAN__"); - if (!prev->flag_finite_math_only && cur->flag_finite_math_only) + if (!prev->x_flag_finite_math_only && cur->x_flag_finite_math_only) { cpp_undef (pfile, "__FINITE_MATH_ONLY__"); cpp_define (pfile, "__FINITE_MATH_ONLY__=1"); } - else if (!prev->flag_finite_math_only && cur->flag_finite_math_only) + else if (!prev->x_flag_finite_math_only && cur->x_flag_finite_math_only) { cpp_undef (pfile, "__FINITE_MATH_ONLY__"); cpp_define (pfile, "__FINITE_MATH_ONLY__=0"); diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index e641ad029cb..ea7227eab8b 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -157,7 +157,7 @@ warning_as_error_callback (int option_index) break; case OPT_Wdeprecated: - cpp_opts->warn_deprecated = 1; + cpp_opts->cpp_warn_deprecated = 1; break; case OPT_Wcomment: @@ -173,11 +173,11 @@ warning_as_error_callback (int option_index) break; case OPT_Wtraditional: - cpp_opts->warn_traditional = 1; + cpp_opts->cpp_warn_traditional = 1; break; case OPT_Wlong_long: - cpp_opts->warn_long_long = 1; + cpp_opts->cpp_warn_long_long = 1; break; case OPT_Wendif_labels: @@ -508,7 +508,7 @@ c_common_handle_option (size_t scode, const char *arg, int value, break; case OPT_Wdeprecated: - cpp_opts->warn_deprecated = value; + cpp_opts->cpp_warn_deprecated = value; break; case OPT_Wendif_labels: @@ -567,7 +567,7 @@ c_common_handle_option (size_t scode, const char *arg, int value, break; case OPT_Wtraditional: - cpp_opts->warn_traditional = value; + cpp_opts->cpp_warn_traditional = value; break; case OPT_Wtrigraphs: @@ -788,7 +788,7 @@ c_common_handle_option (size_t scode, const char *arg, int value, is not overridden. */ case OPT_pedantic_errors: case OPT_pedantic: - cpp_opts->pedantic = 1; + cpp_opts->cpp_pedantic = 1; cpp_opts->warn_endif_labels = 1; if (warn_pointer_sign == -1) warn_pointer_sign = 1; @@ -1314,7 +1314,7 @@ sanitize_cpp_opts (void) if (warn_long_long == -1) warn_long_long = ((pedantic || warn_traditional) && (c_dialect_cxx () ? cxx_dialect == cxx98 : !flag_isoc99)); - cpp_opts->warn_long_long = warn_long_long; + cpp_opts->cpp_warn_long_long = warn_long_long; /* Similarly with -Wno-variadic-macros. No check for c99 here, since this also turns off warnings about GCCs extension. */ @@ -1381,7 +1381,7 @@ finish_options (void) conflict with the specified standard, and since a strictly conforming program cannot contain a '$', we do not condition their acceptance on the -std= setting. */ - cpp_opts->warn_dollars = (cpp_opts->pedantic && !cpp_opts->c99); + cpp_opts->warn_dollars = (cpp_opts->cpp_pedantic && !cpp_opts->c99); cb_file_change (parse_in, linemap_add (line_table, LC_RENAME, 0, diff --git a/gcc/c-parser.c b/gcc/c-parser.c index d21cd767958..aa266e21863 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -884,11 +884,11 @@ disable_extension_diagnostics (void) | (flag_iso << 3) | (warn_long_long << 4) | (warn_cxx_compat << 5)); - cpp_opts->pedantic = pedantic = 0; + cpp_opts->cpp_pedantic = pedantic = 0; warn_pointer_arith = 0; - cpp_opts->warn_traditional = warn_traditional = 0; + cpp_opts->cpp_warn_traditional = warn_traditional = 0; flag_iso = 0; - cpp_opts->warn_long_long = warn_long_long = 0; + cpp_opts->cpp_warn_long_long = warn_long_long = 0; warn_cxx_compat = 0; return ret; } @@ -899,11 +899,11 @@ disable_extension_diagnostics (void) static inline void restore_extension_diagnostics (int flags) { - cpp_opts->pedantic = pedantic = flags & 1; + cpp_opts->cpp_pedantic = pedantic = flags & 1; warn_pointer_arith = (flags >> 1) & 1; - cpp_opts->warn_traditional = warn_traditional = (flags >> 2) & 1; + cpp_opts->cpp_warn_traditional = warn_traditional = (flags >> 2) & 1; flag_iso = (flags >> 3) & 1; - cpp_opts->warn_long_long = warn_long_long = (flags >> 4) & 1; + cpp_opts->cpp_warn_long_long = warn_long_long = (flags >> 4) & 1; warn_cxx_compat = (flags >> 5) & 1; } diff --git a/gcc/combine.c b/gcc/combine.c index 6131b413d1d..5bd4d6e517a 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -962,7 +962,7 @@ create_log_links (void) /* Do not make the log link for frame pointer. */ if ((regno == FRAME_POINTER_REGNUM && (! reload_completed || frame_pointer_needed)) -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER || (regno == HARD_FRAME_POINTER_REGNUM && (! reload_completed || frame_pointer_needed)) #endif @@ -2049,7 +2049,7 @@ combinable_i3pat (rtx i3, rtx *loc, rtx i2dest, rtx i1dest, rtx i0dest, && REG_P (subdest) && reg_referenced_p (subdest, PATTERN (i3)) && REGNO (subdest) != FRAME_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER && REGNO (subdest) != HARD_FRAME_POINTER_REGNUM #endif #if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM @@ -12802,7 +12802,7 @@ mark_used_regs_combine (rtx x) { /* None of this applies to the stack, frame or arg pointers. */ if (regno == STACK_POINTER_REGNUM -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER || regno == HARD_FRAME_POINTER_REGNUM #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM diff --git a/gcc/common.opt b/gcc/common.opt index aa17ae80b3f..8a65b93a487 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -647,7 +647,7 @@ Common Driver JoinedOrMissing RejectNegative Var(flag_compare_debug_opt) -fcompare-debug[=] Compile with and without e.g. -gtoggle, and compare the final-insns dump fcompare-debug-second -Common Driver RejectNegative Var(flag_compare_debug) +Common Driver RejectNegative Run only the second compilation of -fcompare-debug fconserve-stack diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index be885c1235d..bdf31599d07 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -144,8 +144,6 @@ enum alpha_fp_trap_mode ALPHA_FPTM_SUI /* Software completion, w/underflow & inexact traps */ }; -extern int target_flags; - extern enum alpha_trap_precision alpha_tp; extern enum alpha_fp_rounding_mode alpha_fprm; extern enum alpha_fp_trap_mode alpha_fptm; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 9bbe346d44c..55442f55ad4 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -989,6 +989,9 @@ extern int arm_structure_size_boundary; ? ARM_HARD_FRAME_POINTER_REGNUM \ : THUMB_HARD_FRAME_POINTER_REGNUM) +#define HARD_FRAME_POINTER_IS_FRAME_POINTER 0 +#define HARD_FRAME_POINTER_IS_ARG_POINTER 0 + #define FP_REGNUM HARD_FRAME_POINTER_REGNUM /* Register to use for pushing function arguments. */ diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index 30b298d76e1..11cc5cab71b 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -72,10 +72,6 @@ extern unsigned int bfin_workarounds; /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (BlackFin bfin)") -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - /* Predefinition in the preprocessor for this target machine */ #ifndef TARGET_CPU_CPP_BUILTINS #define TARGET_CPU_CPP_BUILTINS() \ diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index d302c9f5540..cd4a22d23a3 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -280,9 +280,6 @@ extern int cris_cpu_version; } \ while (0) -/* This needs to be at least 32 bits. */ -extern int target_flags; - /* Previously controlled by target_flags. */ #define TARGET_ELF 1 diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c index c03c8515bc3..1993c624bf5 100644 --- a/gcc/config/i386/i386-c.c +++ b/gcc/config/i386/i386-c.c @@ -1,5 +1,5 @@ /* Subroutines used for macro/preprocessor support on the ia-32. - Copyright (C) 2008, 2009 + Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -297,8 +297,8 @@ ix86_pragma_target_parse (tree args, tree pop_target) /* Figure out the previous/current isa, arch, tune and the differences. */ prev_opt = TREE_TARGET_OPTION (prev_tree); cur_opt = TREE_TARGET_OPTION (cur_tree); - prev_isa = prev_opt->ix86_isa_flags; - cur_isa = cur_opt->ix86_isa_flags; + prev_isa = prev_opt->x_ix86_isa_flags; + cur_isa = cur_opt->x_ix86_isa_flags; diff_isa = (prev_isa ^ cur_isa); prev_arch = (enum processor_type) prev_opt->arch; prev_tune = (enum processor_type) prev_opt->tune; diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c13479a55e2..20775213aa4 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1898,7 +1898,6 @@ int x86_prefetch_sse; static int ix86_regparm; /* -mstackrealign option */ -extern int ix86_force_align_arg_pointer; static const char ix86_force_align_arg_pointer_string[] = "force_align_arg_pointer"; @@ -3860,7 +3859,7 @@ ix86_function_specific_print (FILE *file, int indent, struct cl_target_option *ptr) { char *target_string - = ix86_target_string (ptr->ix86_isa_flags, ptr->target_flags, + = ix86_target_string (ptr->x_ix86_isa_flags, ptr->x_target_flags, NULL, NULL, NULL, false); fprintf (file, "%*sarch = %d (%s)\n", @@ -4117,8 +4116,8 @@ ix86_valid_target_attribute_tree (tree args) ix86_option_override_internal, and then save the options away. The string options are are attribute options, and will be undone when we copy the save structure. */ - if (ix86_isa_flags != def->ix86_isa_flags - || target_flags != def->target_flags + if (ix86_isa_flags != def->x_ix86_isa_flags + || target_flags != def->x_target_flags || option_strings[IX86_FUNCTION_SPECIFIC_ARCH] || option_strings[IX86_FUNCTION_SPECIFIC_TUNE] || option_strings[IX86_FUNCTION_SPECIFIC_FPMATH]) @@ -4235,12 +4234,12 @@ ix86_can_inline_p (tree caller, tree callee) /* Callee's isa options should a subset of the caller's, i.e. a SSE4 function can inline a SSE2 function but a SSE2 function can't inline a SSE4 function. */ - if ((caller_opts->ix86_isa_flags & callee_opts->ix86_isa_flags) - != callee_opts->ix86_isa_flags) + if ((caller_opts->x_ix86_isa_flags & callee_opts->x_ix86_isa_flags) + != callee_opts->x_ix86_isa_flags) ret = false; /* See if we have the same non-isa options. */ - else if (caller_opts->target_flags != callee_opts->target_flags) + else if (caller_opts->x_target_flags != callee_opts->x_target_flags) ret = false; /* See if arch, tune, etc. are the same. */ diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index e1c13ac3af4..62f35cae2ec 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -447,8 +447,6 @@ extern int x86_prefetch_sse; #define TARGET_ANY_GNU_TLS (TARGET_GNU_TLS || TARGET_GNU2_TLS) #define TARGET_SUN_TLS 0 -extern int ix86_isa_flags; - #ifndef TARGET_64BIT_DEFAULT #define TARGET_64BIT_DEFAULT 0 #endif diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h index 2698d40b896..f629d0fcf62 100644 --- a/gcc/config/lm32/lm32.h +++ b/gcc/config/lm32/lm32.h @@ -68,8 +68,6 @@ #undef LIB_SPEC #define LIB_SPEC "%{!T*:-T sim.ld}" -extern int target_flags; - /* Add -G xx support. */ #undef SWITCH_TAKES_ARG diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h index 5044811761b..11047c91a21 100644 --- a/gcc/config/mcore/mcore.h +++ b/gcc/config/mcore/mcore.h @@ -134,7 +134,6 @@ extern char * mcore_current_function_name; #define STACK_BOUNDARY (TARGET_8ALIGN ? 64 : 32) /* Largest increment in UNITS we allow the stack to grow in a single operation. */ -extern int mcore_stack_increment; #define STACK_UNITS_MAXSTEP 4096 /* Allocation boundary (in *bits*) for the code of a function. */ diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md index 65b91588fc2..532181db0cc 100644 --- a/gcc/config/mcore/mcore.md +++ b/gcc/config/mcore/mcore.md @@ -1,5 +1,5 @@ ;; Machine description the Motorola MCore -;; Copyright (C) 1993, 1999, 2000, 2004, 2005, 2007 +;; Copyright (C) 1993, 1999, 2000, 2004, 2005, 2007, 2009, 2010 ;; Free Software Foundation, Inc. ;; Contributed by Motorola. @@ -697,8 +697,6 @@ "" " { - extern int flag_omit_frame_pointer; - /* If this is an add to the frame pointer, then accept it as is so that we can later fold in the fp/sp offset from frame pointer elimination. */ diff --git a/gcc/config/mep/mep.h b/gcc/config/mep/mep.h index 1bebf3badb7..ad2cf306a5a 100644 --- a/gcc/config/mep/mep.h +++ b/gcc/config/mep/mep.h @@ -108,8 +108,6 @@ crtbegin.o%s" } \ while (0) -extern int target_flags; - /* Controlled by MeP-Integrator. */ #define TARGET_H1 0 diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 4f44130c5a5..608c2096123 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -1736,6 +1736,9 @@ enum mips_code_readable_setting { #define HARD_FRAME_POINTER_REGNUM \ (TARGET_MIPS16 ? GP_REG_FIRST + 17 : GP_REG_FIRST + 30) +#define HARD_FRAME_POINTER_IS_FRAME_POINTER 0 +#define HARD_FRAME_POINTER_IS_ARG_POINTER 0 + /* Register in which static-chain is passed to a function. */ #define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 15) diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index 5908a754284..b4fc856fbaa 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -140,8 +140,6 @@ struct GTY(()) machine_function } \ while (0) -extern int target_flags; - #define TARGET_DEFAULT \ (MASK_BRANCH_PREDICT | MASK_BASE_ADDRESSES | MASK_USE_RETURN_INSN) diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 24edf6cb98c..627e6389061 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -471,7 +471,6 @@ extern int rs6000_float_gprs; extern int rs6000_alignment_flags; extern const char *rs6000_sched_insert_nops_str; extern enum rs6000_nop_insertion rs6000_sched_insert_nops; -extern int rs6000_xilinx_fpu; /* Describe which vector unit to use for a given machine mode. */ enum rs6000_vector { @@ -2417,9 +2416,7 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */ /* #define MACHINE_no_sched_speculative_load */ /* General flags. */ -extern int flag_pic; extern int optimize; -extern int flag_expensive_optimizations; extern int frame_pointer_needed; /* Classification of the builtin functions to properly set the declaration tree diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index fcc63b0d332..8c8554f96e0 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -869,8 +869,6 @@ do { \ /* Position independent code. */ -extern int flag_pic; - #define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 12 : INVALID_REGNUM) #define LEGITIMATE_PIC_OPERAND_P(X) legitimate_pic_operand_p (X) diff --git a/gcc/config/score/score-conv.h b/gcc/config/score/score-conv.h index e042dc1b7d3..3a40090dbc9 100644 --- a/gcc/config/score/score-conv.h +++ b/gcc/config/score/score-conv.h @@ -1,5 +1,5 @@ /* score-conv.h for Sunplus S+CORE processor - Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -20,8 +20,6 @@ #ifndef GCC_SCORE_CONV_H #define GCC_SCORE_CONV_H -extern int target_flags; - #define GP_REG_FIRST 0U #define GP_REG_LAST 31U #define GP_REG_NUM (GP_REG_LAST - GP_REG_FIRST + 1U) diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 2e9ee76d3ef..d196e39c07f 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -503,8 +503,6 @@ extern enum sh_divide_strategy_e sh_div_strategy; #define SUBTARGET_OVERRIDE_OPTIONS (void) 0 -extern const char *sh_fixed_range_str; - /* Target machine storage layout. */ diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h index 878cb6383e5..9f72cb228f5 100644 --- a/gcc/config/spu/spu.h +++ b/gcc/config/spu/spu.h @@ -24,9 +24,6 @@ #define INIT_EXPANDERS spu_init_expanders() -extern int target_flags; -extern const char *spu_fixed_range_string; - /* Which processor to generate code or schedule for. */ enum processor_type { diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 572fa64eb8c..e5396b2a1d8 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -3015,7 +3015,7 @@ dbxout_symbol_location (tree decl, tree type, const char *suffix, rtx home) || (REG_P (XEXP (home, 0)) && REGNO (XEXP (home, 0)) != HARD_FRAME_POINTER_REGNUM && REGNO (XEXP (home, 0)) != STACK_POINTER_REGNUM -#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_ARG_POINTER && REGNO (XEXP (home, 0)) != ARG_POINTER_REGNUM #endif ))) @@ -3429,7 +3429,7 @@ dbxout_parms (tree parms) && REG_P (XEXP (DECL_RTL (parms), 0)) && REGNO (XEXP (DECL_RTL (parms), 0)) != HARD_FRAME_POINTER_REGNUM && REGNO (XEXP (DECL_RTL (parms), 0)) != STACK_POINTER_REGNUM -#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_ARG_POINTER && REGNO (XEXP (DECL_RTL (parms), 0)) != ARG_POINTER_REGNUM #endif ) diff --git a/gcc/df-scan.c b/gcc/df-scan.c index f98df02f423..0b636e99ea8 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -3406,7 +3406,7 @@ df_insn_refs_collect (struct df_collection_rec* collection_rec, regno_reg_rtx[FRAME_POINTER_REGNUM], NULL, bb, insn_info, DF_REF_REG_USE, 0); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[HARD_FRAME_POINTER_REGNUM], NULL, bb, insn_info, @@ -3604,7 +3604,7 @@ df_get_regular_block_artificial_uses (bitmap regular_block_artificial_uses) reference of the frame pointer. */ bitmap_set_bit (regular_block_artificial_uses, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER bitmap_set_bit (regular_block_artificial_uses, HARD_FRAME_POINTER_REGNUM); #endif @@ -3656,7 +3656,7 @@ df_get_eh_block_artificial_uses (bitmap eh_block_artificial_uses) if (frame_pointer_needed) { bitmap_set_bit (eh_block_artificial_uses, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER bitmap_set_bit (eh_block_artificial_uses, HARD_FRAME_POINTER_REGNUM); #endif } @@ -3744,7 +3744,7 @@ df_get_entry_block_def_set (bitmap entry_block_defs) /* Any reference to any pseudo before reload is a potential reference of the frame pointer. */ bitmap_set_bit (entry_block_defs, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER /* If they are different, also mark the hard frame pointer as live. */ if (!LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM)) bitmap_set_bit (entry_block_defs, HARD_FRAME_POINTER_REGNUM); @@ -3877,7 +3877,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses) if ((!reload_completed) || frame_pointer_needed) { bitmap_set_bit (exit_block_uses, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER /* If they are different, also mark the hard frame pointer as live. */ if (!LOCAL_REGNO (HARD_FRAME_POINTER_REGNUM)) bitmap_set_bit (exit_block_uses, HARD_FRAME_POINTER_REGNUM); diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 34e9679693f..a057f8d8f48 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -107,8 +107,8 @@ diagnostic_initialize (diagnostic_context *context, int n_opts) context->permissive = false; context->opt_permissive = 0; context->fatal_errors = false; - context->inhibit_warnings = false; - context->warn_system_headers = false; + context->dc_inhibit_warnings = false; + context->dc_warn_system_headers = false; context->internal_error = NULL; diagnostic_starter (context) = default_diagnostic_starter; diagnostic_finalizer (context) = default_diagnostic_finalizer; diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index d3840749e91..f91efc6e04d 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -124,10 +124,10 @@ struct diagnostic_context bool fatal_errors; /* True if all warnings should be disabled. */ - bool inhibit_warnings; + bool dc_inhibit_warnings; /* True if warnings should be given in system headers. */ - bool warn_system_headers; + bool dc_warn_system_headers; /* This function is called before any message is printed out. It is responsible for preparing message prefix and such. For example, it @@ -230,8 +230,8 @@ extern diagnostic_context *global_dc; /* Returns nonzero if warnings should be emitted. */ #define diagnostic_report_warnings_p(DC, LOC) \ - (!(DC)->inhibit_warnings \ - && !(in_system_header_at (LOC) && !(DC)->warn_system_headers)) + (!(DC)->dc_inhibit_warnings \ + && !(in_system_header_at (LOC) && !(DC)->dc_warn_system_headers)) #define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index bbda85a43a7..e1e095758ec 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3643,6 +3643,22 @@ pointer register, then you must mark it as a fixed register according to (@pxref{Elimination}). @end defmac +@defmac HARD_FRAME_POINTER_IS_FRAME_POINTER +Define this to a preprocessor constant that is nonzero if +@code{hard_frame_pointer_rtx} and @code{frame_pointer_rtx} should be +the same. The default definition is @samp{(HARD_FRAME_POINTER_REGNUM +== FRAME_POINTER_REGNUM)}; you only need to define this macro if that +definition is not suitable for use in preprocessor conditionals. +@end defmac + +@defmac HARD_FRAME_POINTER_IS_ARG_POINTER +Define this to a preprocessor constant that is nonzero if +@code{hard_frame_pointer_rtx} and @code{arg_pointer_rtx} should be the +same. The default definition is @samp{(HARD_FRAME_POINTER_REGNUM == +ARG_POINTER_REGNUM)}; you only need to define this macro if that +definition is not suitable for use in preprocessor conditionals. +@end defmac + @defmac RETURN_ADDRESS_POINTER_REGNUM The register number of the return address pointer register, which is used to access the current function's return address from the stack. On some diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 7f0b460927b..cb22a05aa83 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -3643,6 +3643,22 @@ pointer register, then you must mark it as a fixed register according to (@pxref{Elimination}). @end defmac +@defmac HARD_FRAME_POINTER_IS_FRAME_POINTER +Define this to a preprocessor constant that is nonzero if +@code{hard_frame_pointer_rtx} and @code{frame_pointer_rtx} should be +the same. The default definition is @samp{(HARD_FRAME_POINTER_REGNUM +== FRAME_POINTER_REGNUM)}; you only need to define this macro if that +definition is not suitable for use in preprocessor conditionals. +@end defmac + +@defmac HARD_FRAME_POINTER_IS_ARG_POINTER +Define this to a preprocessor constant that is nonzero if +@code{hard_frame_pointer_rtx} and @code{arg_pointer_rtx} should be the +same. The default definition is @samp{(HARD_FRAME_POINTER_REGNUM == +ARG_POINTER_REGNUM)}; you only need to define this macro if that +definition is not suitable for use in preprocessor conditionals. +@end defmac + @defmac RETURN_ADDRESS_POINTER_REGNUM The register number of the return address pointer register, which is used to access the current function's return address from the stack. On some diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 12d057d8855..735a0c243ca 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -16567,7 +16567,7 @@ rtl_for_decl_location (tree decl) && (!REG_P (XEXP (rtl, 0)) || REGNO (XEXP (rtl, 0)) == HARD_FRAME_POINTER_REGNUM || REGNO (XEXP (rtl, 0)) == STACK_POINTER_REGNUM -#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_ARG_POINTER || REGNO (XEXP (rtl, 0)) == ARG_POINTER_REGNUM #endif ) diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 16032e94044..3115523fb8c 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -589,12 +589,12 @@ gen_rtx_REG (enum machine_mode mode, unsigned int regno) if (regno == FRAME_POINTER_REGNUM && (!reload_completed || frame_pointer_needed)) return frame_pointer_rtx; -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER if (regno == HARD_FRAME_POINTER_REGNUM && (!reload_completed || frame_pointer_needed)) return hard_frame_pointer_rtx; #endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && HARD_FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM +#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && !HARD_FRAME_POINTER_IS_ARG_POINTER if (regno == ARG_POINTER_REGNUM) return arg_pointer_rtx; #endif diff --git a/gcc/flags.h b/gcc/flags.h index 805308cf984..893daee6f37 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -77,6 +77,11 @@ extern void set_struct_debug_option (const char *value); debugging information. */ extern bool use_gnu_debug_info_extensions; +/* Run the second compilation of -fcompare-debug. Not defined using + Var in common.opt because this is used in Ada code and so must be + an actual variable not a macro. */ +extern int flag_compare_debug; + /* Enumerate visibility settings. This is deliberately ordered from most to least visibility. */ #ifndef SYMBOL_VISIBILITY_DEFINED diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ef7257d1e4e..9114f1cd70c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,25 @@ +2010-09-29 Joseph Myers + + * cpp.c (cpp_define_builtins): Update names of gfc_option_t + members. + (gfc_cpp_post_options): Update names of cpp_options members. + (cb_cpp_error): Update names of diagnostic_context members. + * f95-lang.c (gfc_init_builtin_functions): Update names of + gfc_option_t members. + * gfortran.h (gfc_option_t): Rename warn_conversion and + flag_openmp. + * intrinsic.c (gfc_convert_type_warn): Update names of + gfc_option_t members. + * options.c (gfc_init_options, gfc_post_options, set_Wall, + gfc_handle_option): Update names of gfc_option_t members. + * parse.c (next_free, next_fixed): Update names of gfc_option_t + members. + * scanner.c (pedantic): Remove extern declaration. + (skip_free_comments, skip_fixed_comments, include_line): Update + names of gfc_option_t members. + * trans-decl.c (gfc_generate_function_code): Update names of + gfc_option_t members. + 2010-09-28 Tobias Burnus PR fortran/40569 diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c index a6a922f0ff9..908c92acc96 100644 --- a/gcc/fortran/cpp.c +++ b/gcc/fortran/cpp.c @@ -176,7 +176,7 @@ cpp_define_builtins (cpp_reader *pfile) cpp_define (pfile, "__GFORTRAN__=1"); cpp_define (pfile, "_LANGUAGE_FORTRAN=1"); - if (gfc_option.flag_openmp) + if (gfc_option.gfc_flag_openmp) cpp_define (pfile, "_OPENMP=200805"); @@ -526,7 +526,7 @@ gfc_cpp_post_options (void) cpp_option->traditional = 1; cpp_option->cplusplus_comments = 0; - cpp_option->pedantic = pedantic; + cpp_option->cpp_pedantic = pedantic; cpp_option->dollars_in_ident = gfc_option.flag_dollar_ok; cpp_option->discard_comments = gfc_cpp_option.discard_comments; @@ -1075,13 +1075,13 @@ cb_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason, { diagnostic_info diagnostic; diagnostic_t dlevel; - bool save_warn_system_headers = global_dc->warn_system_headers; + bool save_warn_system_headers = global_dc->dc_warn_system_headers; bool ret; switch (level) { case CPP_DL_WARNING_SYSHDR: - global_dc->warn_system_headers = 1; + global_dc->dc_warn_system_headers = 1; /* Fall through. */ case CPP_DL_WARNING: dlevel = DK_WARNING; @@ -1112,7 +1112,7 @@ cb_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, int reason, diagnostic_override_option_index (&diagnostic, OPT_Wcpp); ret = report_diagnostic (&diagnostic); if (level == CPP_DL_WARNING_SYSHDR) - global_dc->warn_system_headers = save_warn_system_headers; + global_dc->dc_warn_system_headers = save_warn_system_headers; return ret; } diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index dc678477e4d..f222139d942 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -1089,7 +1089,7 @@ gfc_init_builtin_functions (void) #include "../sync-builtins.def" #undef DEF_SYNC_BUILTIN - if (gfc_option.flag_openmp || flag_tree_parallelize_loops) + if (gfc_option.gfc_flag_openmp || flag_tree_parallelize_loops) { #undef DEF_GOMP_BUILTIN #define DEF_GOMP_BUILTIN(code, name, type, attr) \ diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index c42be85783a..a2287a5ca1e 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2190,7 +2190,7 @@ typedef struct int warn_aliasing; int warn_ampersand; - int warn_conversion; + int gfc_warn_conversion; int warn_conversion_extra; int warn_implicit_interface; int warn_implicit_procedure; @@ -2230,7 +2230,7 @@ typedef struct int blas_matmul_limit; int flag_cray_pointer; int flag_d_lines; - int flag_openmp; + int gfc_flag_openmp; int flag_sign_zero; int flag_module_private; int flag_recursive; diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index 436afb70a7a..84547973d8c 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -4320,7 +4320,7 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag) gfc_warning_now ("Conversion from %s to %s at %L", gfc_typename (&from_ts), gfc_typename (ts), &expr->where); - else if (gfc_option.warn_conversion + else if (gfc_option.gfc_warn_conversion && from_ts.kind > ts->kind) gfc_warning_now ("Possible change of value in conversion " "from %s to %s at %L", gfc_typename (&from_ts), @@ -4333,7 +4333,7 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag) /* Conversion from REAL/COMPLEX to INTEGER or COMPLEX to REAL usually comes with a loss of information, regardless of kinds. */ if (gfc_option.warn_conversion_extra - || gfc_option.warn_conversion) + || gfc_option.gfc_warn_conversion) gfc_warning_now ("Possible change of value in conversion " "from %s to %s at %L", gfc_typename (&from_ts), gfc_typename (ts), &expr->where); @@ -4342,7 +4342,7 @@ gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag) { /* If HOLLERITH is involved, all bets are off. */ if (gfc_option.warn_conversion_extra - || gfc_option.warn_conversion) + || gfc_option.gfc_warn_conversion) gfc_warning_now ("Conversion from %s to %s at %L", gfc_typename (&from_ts), gfc_typename (ts), &expr->where); diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index f7f76f49a7d..b36dd7283ec 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -88,7 +88,7 @@ gfc_init_options (unsigned int decoded_options_count, gfc_option.warn_ampersand = 0; gfc_option.warn_character_truncation = 0; gfc_option.warn_array_temp = 0; - gfc_option.warn_conversion = 0; + gfc_option.gfc_warn_conversion = 0; gfc_option.warn_conversion_extra = 0; gfc_option.warn_implicit_interface = 0; gfc_option.warn_line_truncation = 0; @@ -129,7 +129,7 @@ gfc_init_options (unsigned int decoded_options_count, gfc_option.blas_matmul_limit = 30; gfc_option.flag_cray_pointer = 0; gfc_option.flag_d_lines = -1; - gfc_option.flag_openmp = 0; + gfc_option.gfc_flag_openmp = 0; gfc_option.flag_sign_zero = 1; gfc_option.flag_recursive = 0; gfc_option.flag_init_integer = GFC_INIT_INTEGER_OFF; @@ -357,7 +357,7 @@ gfc_post_options (const char **pfilename) gfc_option.flag_max_stack_var_size); else if (!gfc_option.flag_automatic && gfc_option.flag_recursive) gfc_warning_now ("Flag -fno-automatic overwrites -frecursive"); - else if (!gfc_option.flag_automatic && gfc_option.flag_openmp) + else if (!gfc_option.flag_automatic && gfc_option.gfc_flag_openmp) gfc_warning_now ("Flag -fno-automatic overwrites -frecursive implied by " "-fopenmp"); else if (gfc_option.flag_max_stack_var_size != -2 @@ -365,7 +365,7 @@ gfc_post_options (const char **pfilename) gfc_warning_now ("Flag -frecursive overwrites -fmax-stack-var-size=%d", gfc_option.flag_max_stack_var_size); else if (gfc_option.flag_max_stack_var_size != -2 - && gfc_option.flag_openmp) + && gfc_option.gfc_flag_openmp) gfc_warning_now ("Flag -fmax-stack-var-size=%d overwrites -frecursive " "implied by -fopenmp", gfc_option.flag_max_stack_var_size); @@ -375,7 +375,7 @@ gfc_post_options (const char **pfilename) gfc_option.flag_max_stack_var_size = -1; /* Implied -frecursive; implemented as -fmax-stack-var-size=-1. */ - if (gfc_option.flag_max_stack_var_size == -2 && gfc_option.flag_openmp + if (gfc_option.flag_max_stack_var_size == -2 && gfc_option.gfc_flag_openmp && gfc_option.flag_automatic) { gfc_option.flag_recursive = 1; @@ -419,7 +419,7 @@ set_Wall (int setting) { gfc_option.warn_aliasing = setting; gfc_option.warn_ampersand = setting; - gfc_option.warn_conversion = setting; + gfc_option.gfc_warn_conversion = setting; gfc_option.warn_line_truncation = setting; gfc_option.warn_surprising = setting; gfc_option.warn_tabs = !setting; @@ -581,7 +581,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, break; case OPT_Wconversion: - gfc_option.warn_conversion = value; + gfc_option.gfc_warn_conversion = value; break; case OPT_Wconversion_extra: @@ -707,7 +707,7 @@ gfc_handle_option (size_t scode, const char *arg, int value, break; case OPT_fopenmp: - gfc_option.flag_openmp = value; + gfc_option.gfc_flag_openmp = value; break; case OPT_ffree_line_length_none: diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 4632a250294..268e6afc049 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -693,7 +693,7 @@ next_free (void) return decode_gcc_attribute (); } - else if (c == '$' && gfc_option.flag_openmp) + else if (c == '$' && gfc_option.gfc_flag_openmp) { int i; @@ -780,7 +780,7 @@ next_fixed (void) return decode_gcc_attribute (); } - else if (c == '$' && gfc_option.flag_openmp) + else if (c == '$' && gfc_option.gfc_flag_openmp) { for (i = 0; i < 4; i++, c = gfc_next_char_literal (0)) gcc_assert ((char) gfc_wide_tolower (c) == "$omp"[i]); diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 744abeb26e3..c5d255d8d4b 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -1,6 +1,6 @@ /* Character scanner. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 - Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. Contributed by Andy Vaught This file is part of GCC. @@ -76,8 +76,6 @@ const char *gfc_source_file; static FILE *gfc_src_file; static gfc_char_t *gfc_src_preprocessor_lines[2]; -extern int pedantic; - static struct gfc_file_change { const char *filename; @@ -747,7 +745,7 @@ skip_free_comments (void) 2) handle OpenMP conditional compilation, where !$ should be treated as 2 spaces (for initial lines only if followed by space). */ - if (gfc_option.flag_openmp && at_bol) + if (gfc_option.gfc_flag_openmp && at_bol) { locus old_loc = gfc_current_locus; if (next_char () == '$') @@ -873,7 +871,7 @@ skip_fixed_comments (void) && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb)) continue_line = gfc_linebuf_linenum (gfc_current_locus.lb); - if (gfc_option.flag_openmp) + if (gfc_option.gfc_flag_openmp) { if (next_char () == '$') { @@ -1814,7 +1812,7 @@ include_line (gfc_char_t *line) c = line; - if (gfc_option.flag_openmp) + if (gfc_option.gfc_flag_openmp) { if (gfc_current_form == FORM_FREE) { diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 2a4eb958d9e..457e8f6e851 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -4682,7 +4682,7 @@ gfc_generate_function_code (gfc_namespace * ns) /* Reset recursion-check variable. */ if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive - && !gfc_option.flag_openmp + && !gfc_option.gfc_flag_openmp && recurcheckvar != NULL_TREE) { gfc_add_modify (&cleanup, recurcheckvar, boolean_false_node); diff --git a/gcc/ira.c b/gcc/ira.c index e4dd2d31bb5..dbabd18d74e 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -1389,7 +1389,7 @@ ira_setup_eliminable_regset (void) else df_set_regs_ever_live (eliminables[i].from, true); } -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER if (!TEST_HARD_REG_BIT (crtl->asm_clobbers, HARD_FRAME_POINTER_REGNUM)) { SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM); diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 97192a252cc..9c9b103c037 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,16 @@ +2010-09-29 Joseph Myers + + * java-tree.h (flag_filelist_file, flag_assert, flag_jni, + flag_force_classes_archive_check, flag_redundant, flag_newer, + flag_use_divide_subroutine, flag_use_atomic_builtins, + flag_use_boehm_gc, flag_hash_synchronization, + flag_check_references, flag_optimize_sci, flag_indirect_classes, + flag_indirect_dispatch, flag_store_check, + flag_reduced_reflection): Remove. + * jcf-dump.c (flag_newer): Remove. + * jcf.h (quiet_flag): Remove. + * parse.h (quiet_flag): Remove. + 2010-09-28 Richard Henderson * lang.c: Include "target.h". diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 110eb83e00c..d7c9996c5cd 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -112,64 +112,11 @@ struct JCF; /* The virtual offset symbol table. Used by the runtime to fill out the otable. */ -extern int flag_filelist_file; - -/* When nonzero, permit the use of the assert keyword. */ - -extern int flag_assert; - -/* When nonzero, assume all native functions are implemented with - JNI, not CNI. */ - -extern int flag_jni; - -/* When nonzero, always check for a non gcj generated classes archive. */ - -extern int flag_force_classes_archive_check; - /* Resource name. */ extern const char *resource_name; /* Turned to 1 if -Wall was encountered. See lang.c for their meanings. */ extern int flag_wall; -extern int flag_redundant; - -/* When nonzero, warn when source file is newer than matching class - file. */ -extern int flag_newer; - -/* When nonzero, call a library routine to do integer divisions. */ -extern int flag_use_divide_subroutine; - -/* When nonzero, use atomic builtins. */ -extern int flag_use_atomic_builtins; - -/* When nonzero, generate code for the Boehm GC. */ -extern int flag_use_boehm_gc; - -/* When nonzero, assume the runtime uses a hash table to map an - object to its synchronization structure. */ -extern int flag_hash_synchronization; - -/* When nonzero, generate checks for references to NULL. */ -extern int flag_check_references; - -/* Used through STATIC_CLASS_INIT_OPT_P to check whether static - initialization optimization should be performed. */ -extern int flag_optimize_sci; - -/* Generate instances of Class at runtime. */ -extern int flag_indirect_classes; - -/* When nonzero, use offset tables for virtual method calls - in order to improve binary compatibility. */ -extern int flag_indirect_dispatch; - -/* When zero, don't generate runtime array store checks. */ -extern int flag_store_check; - -/* When nonzero, generate only a limited set of class meta-data. */ -extern int flag_reduced_reflection; /* The Java .class file that provides main_class; the main input file. */ extern GTY(()) struct JCF * current_jcf; diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c index 2012f7b0eac..9956c41cd43 100644 --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -76,10 +76,6 @@ int flag_print_fields = 1; int flag_print_methods = 1; int flag_print_attributes = 1; -/* When nonzero, warn when source file is newer than matching class - file. */ -int flag_newer = 1; - /* Print names of classes that have a "main" method. */ int flag_print_main = 0; diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h index c7a789d6f2b..b066b2967c3 100644 --- a/gcc/java/jcf.h +++ b/gcc/java/jcf.h @@ -1,6 +1,6 @@ /* Utility macros to read Java(TM) .class files and byte codes. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2006, 2007, 2008 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -274,7 +274,6 @@ extern const char *jcf_write_base_directory; /* Debug macros, for the front end */ -extern int quiet_flag; #ifdef VERBOSE_SKELETON #undef SOURCE_FRONTEND_DEBUG #define SOURCE_FRONTEND_DEBUG(X) \ diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 7aa5d6008fc..28f431c40fd 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -1,6 +1,6 @@ /* Language parser definitions for the GNU compiler for the Java(TM) language. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007 Free Software Foundation, Inc. + 2005, 2006, 2007, 2010 Free Software Foundation, Inc. Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com) This file is part of GCC. @@ -28,7 +28,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ /* Extern global variable declarations */ extern struct obstack temporary_obstack; -extern int quiet_flag; #ifdef VERBOSE_SKELETON #undef SOURCE_FRONTEND_DEBUG diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 4a146dddffb..c43557b1b03 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -85,8 +85,19 @@ print "#endif /* GCC_DRIVER */" print "" have_save = 0; +print "struct gcc_options global_options =\n{" for (i = 0; i < n_extra_vars; i++) { - print extra_vars[i] ";" + var = extra_vars[i] + init = extra_vars[i] + if (var ~ "=" ) { + sub(".*= *", "", init) + sub(" *=.*", "", var) + sub("^.*[ *]", "", var) + } else { + init = "0" + } + var_seen[var] = 1 + print " " init ", /* " var " */" } for (i = 0; i < n_opts; i++) { if (flag_set_p("Save", flags[i])) @@ -96,24 +107,31 @@ for (i = 0; i < n_opts; i++) { if (name == "") continue; - if (flag_set_p("VarExists", flags[i])) { + init = opt_args("Init", flags[i]) + if (init != "") { + if (name in var_init && var_init[name] != init) + print "#error multiple initializers for " name + var_init[name] = init + } +} +for (i = 0; i < n_opts; i++) { + name = var_name(flags[i]); + if (name == "") continue; - } - else { - init = opt_args("Init", flags[i]) - if (init != "") - init = " = " init; - else if (name in var_seen) - continue; - } - print "/* Set by -" opts[i] "." - print " " help[i] " */" - print var_type(flags[i]) name init ";" - print "" + if (name in var_seen) + continue; + + if (name in var_init) + init = var_init[name] + else + init = "0" + + print " " init ", /* " name " */" var_seen[name] = 1; } +print "};" print "" print "/* Local state variables. */" @@ -332,19 +350,19 @@ for (i = 0; i < n_opt_char; i++) { print ""; for (i = 0; i < n_opt_other; i++) { - print " ptr->" var_opt_other[i] " = " var_opt_other[i] ";"; + print " ptr->x_" var_opt_other[i] " = " var_opt_other[i] ";"; } for (i = 0; i < n_opt_int; i++) { - print " ptr->" var_opt_int[i] " = " var_opt_int[i] ";"; + print " ptr->x_" var_opt_int[i] " = " var_opt_int[i] ";"; } for (i = 0; i < n_opt_short; i++) { - print " ptr->" var_opt_short[i] " = " var_opt_short[i] ";"; + print " ptr->x_" var_opt_short[i] " = " var_opt_short[i] ";"; } for (i = 0; i < n_opt_char; i++) { - print " ptr->" var_opt_char[i] " = " var_opt_char[i] ";"; + print " ptr->x_" var_opt_char[i] " = " var_opt_char[i] ";"; } print "}"; @@ -356,19 +374,19 @@ print "cl_optimization_restore (struct cl_optimization *ptr)"; print "{"; for (i = 0; i < n_opt_other; i++) { - print " " var_opt_other[i] " = ptr->" var_opt_other[i] ";"; + print " " var_opt_other[i] " = ptr->x_" var_opt_other[i] ";"; } for (i = 0; i < n_opt_int; i++) { - print " " var_opt_int[i] " = ptr->" var_opt_int[i] ";"; + print " " var_opt_int[i] " = ptr->x_" var_opt_int[i] ";"; } for (i = 0; i < n_opt_short; i++) { - print " " var_opt_short[i] " = ptr->" var_opt_short[i] ";"; + print " " var_opt_short[i] " = ptr->x_" var_opt_short[i] ";"; } for (i = 0; i < n_opt_char; i++) { - print " " var_opt_char[i] " = ptr->" var_opt_char[i] ";"; + print " " var_opt_char[i] " = ptr->x_" var_opt_char[i] ";"; } print " targetm.override_options_after_change ();"; @@ -384,38 +402,38 @@ print "{"; print " fputs (\"\\n\", file);"; for (i = 0; i < n_opt_other; i++) { - print " if (ptr->" var_opt_other[i] ")"; + print " if (ptr->x_" var_opt_other[i] ")"; print " fprintf (file, \"%*s%s (%#lx)\\n\","; print " indent_to, \"\","; print " \"" var_opt_other[i] "\","; - print " (unsigned long)ptr->" var_opt_other[i] ");"; + print " (unsigned long)ptr->x_" var_opt_other[i] ");"; print ""; } for (i = 0; i < n_opt_int; i++) { - print " if (ptr->" var_opt_int[i] ")"; + print " if (ptr->x_" var_opt_int[i] ")"; print " fprintf (file, \"%*s%s (%#x)\\n\","; print " indent_to, \"\","; print " \"" var_opt_int[i] "\","; - print " ptr->" var_opt_int[i] ");"; + print " ptr->x_" var_opt_int[i] ");"; print ""; } for (i = 0; i < n_opt_short; i++) { - print " if (ptr->" var_opt_short[i] ")"; + print " if (ptr->x_" var_opt_short[i] ")"; print " fprintf (file, \"%*s%s (%#x)\\n\","; print " indent_to, \"\","; print " \"" var_opt_short[i] "\","; - print " ptr->" var_opt_short[i] ");"; + print " ptr->x_" var_opt_short[i] ");"; print ""; } for (i = 0; i < n_opt_char; i++) { - print " if (ptr->" var_opt_char[i] ")"; + print " if (ptr->x_" var_opt_char[i] ")"; print " fprintf (file, \"%*s%s (%#x)\\n\","; print " indent_to, \"\","; print " \"" var_opt_char[i] "\","; - print " ptr->" var_opt_char[i] ");"; + print " ptr->x_" var_opt_char[i] ");"; print ""; } @@ -482,19 +500,19 @@ print " targetm.target_option.save (ptr);"; print ""; for (i = 0; i < n_target_other; i++) { - print " ptr->" var_target_other[i] " = " var_target_other[i] ";"; + print " ptr->x_" var_target_other[i] " = " var_target_other[i] ";"; } for (i = 0; i < n_target_int; i++) { - print " ptr->" var_target_int[i] " = " var_target_int[i] ";"; + print " ptr->x_" var_target_int[i] " = " var_target_int[i] ";"; } for (i = 0; i < n_target_short; i++) { - print " ptr->" var_target_short[i] " = " var_target_short[i] ";"; + print " ptr->x_" var_target_short[i] " = " var_target_short[i] ";"; } for (i = 0; i < n_target_char; i++) { - print " ptr->" var_target_char[i] " = " var_target_char[i] ";"; + print " ptr->x_" var_target_char[i] " = " var_target_char[i] ";"; } print "}"; @@ -506,19 +524,19 @@ print "cl_target_option_restore (struct cl_target_option *ptr)"; print "{"; for (i = 0; i < n_target_other; i++) { - print " " var_target_other[i] " = ptr->" var_target_other[i] ";"; + print " " var_target_other[i] " = ptr->x_" var_target_other[i] ";"; } for (i = 0; i < n_target_int; i++) { - print " " var_target_int[i] " = ptr->" var_target_int[i] ";"; + print " " var_target_int[i] " = ptr->x_" var_target_int[i] ";"; } for (i = 0; i < n_target_short; i++) { - print " " var_target_short[i] " = ptr->" var_target_short[i] ";"; + print " " var_target_short[i] " = ptr->x_" var_target_short[i] ";"; } for (i = 0; i < n_target_char; i++) { - print " " var_target_char[i] " = ptr->" var_target_char[i] ";"; + print " " var_target_char[i] " = ptr->x_" var_target_char[i] ";"; } # This must occur after the normal variables in case the code depends on those @@ -539,38 +557,38 @@ print "{"; print " fputs (\"\\n\", file);"; for (i = 0; i < n_target_other; i++) { - print " if (ptr->" var_target_other[i] ")"; + print " if (ptr->x_" var_target_other[i] ")"; print " fprintf (file, \"%*s%s (%#lx)\\n\","; print " indent, \"\","; print " \"" var_target_other[i] "\","; - print " (unsigned long)ptr->" var_target_other[i] ");"; + print " (unsigned long)ptr->x_" var_target_other[i] ");"; print ""; } for (i = 0; i < n_target_int; i++) { - print " if (ptr->" var_target_int[i] ")"; + print " if (ptr->x_" var_target_int[i] ")"; print " fprintf (file, \"%*s%s (%#x)\\n\","; print " indent, \"\","; print " \"" var_target_int[i] "\","; - print " ptr->" var_target_int[i] ");"; + print " ptr->x_" var_target_int[i] ");"; print ""; } for (i = 0; i < n_target_short; i++) { - print " if (ptr->" var_target_short[i] ")"; + print " if (ptr->x_" var_target_short[i] ")"; print " fprintf (file, \"%*s%s (%#x)\\n\","; print " indent, \"\","; print " \"" var_target_short[i] "\","; - print " ptr->" var_target_short[i] ");"; + print " ptr->x_" var_target_short[i] ");"; print ""; } for (i = 0; i < n_target_char; i++) { - print " if (ptr->" var_target_char[i] ")"; + print " if (ptr->x_" var_target_char[i] ")"; print " fprintf (file, \"%*s%s (%#x)\\n\","; print " indent, \"\","; print " \"" var_target_char[i] "\","; - print " ptr->" var_target_char[i] ");"; + print " ptr->x_" var_target_char[i] ");"; print ""; } diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk index 423328ddfdb..c15babdb6db 100644 --- a/gcc/opth-gen.awk +++ b/gcc/opth-gen.awk @@ -75,10 +75,25 @@ print "" have_save = 0; +print "#ifndef GENERATOR_FILE" +print "struct gcc_options\n{" +print "#endif" + for (i = 0; i < n_extra_vars; i++) { var = extra_vars[i] sub(" *=.*", "", var) - print "extern " var ";" + orig_var = var + name = var + type = var + sub("^.*[ *]", "", name) + sub(" *" name "$", "", type) + var_seen[name] = 1 + print "#ifdef GENERATOR_FILE" + print "extern " orig_var ";" + print "#else" + print " " type " x_" name ";" + print "#define " name " global_options.x_" name + print "#endif" } for (i = 0; i < n_opts; i++) { @@ -93,8 +108,17 @@ for (i = 0; i < n_opts; i++) { continue; var_seen[name] = 1; + print "#ifdef GENERATOR_FILE" print "extern " var_type(flags[i]) name ";" + print "#else" + print " " var_type(flags[i]) "x_" name ";" + print "#define " name " global_options.x_" name + print "#endif" } +print "#ifndef GENERATOR_FILE" +print "};" +print "extern struct gcc_options global_options;" +print "#endif" print "" # All of the optimization switches gathered together so they can be saved and restored. @@ -114,8 +138,8 @@ n_opt_char = 2; n_opt_short = 0; n_opt_int = 0; n_opt_other = 0; -var_opt_char[0] = "unsigned char optimize"; -var_opt_char[1] = "unsigned char optimize_size"; +var_opt_char[0] = "unsigned char x_optimize"; +var_opt_char[1] = "unsigned char x_optimize_size"; for (i = 0; i < n_opts; i++) { if (flag_set_p("Optimization", flags[i])) { @@ -129,16 +153,16 @@ for (i = 0; i < n_opts; i++) { var_opt_seen[name]++; otype = var_type_struct(flags[i]); if (otype ~ "^((un)?signed +)?int *$") - var_opt_int[n_opt_int++] = otype name; + var_opt_int[n_opt_int++] = otype "x_" name; else if (otype ~ "^((un)?signed +)?short *$") - var_opt_short[n_opt_short++] = otype name; + var_opt_short[n_opt_short++] = otype "x_" name; else if (otype ~ "^((un)?signed +)?char *$") - var_opt_char[n_opt_char++] = otype name; + var_opt_char[n_opt_char++] = otype "x_" name; else - var_opt_other[n_opt_other++] = otype name; + var_opt_other[n_opt_other++] = otype "x_" name; } } @@ -198,20 +222,20 @@ if (have_save) { var_save_seen[name]++; otype = var_type_struct(flags[i]) if (otype ~ "^((un)?signed +)?int *$") - var_target_int[n_target_int++] = otype name; + var_target_int[n_target_int++] = otype "x_" name; else if (otype ~ "^((un)?signed +)?short *$") - var_target_short[n_target_short++] = otype name; + var_target_short[n_target_short++] = otype "x_" name; else if (otype ~ "^((un)?signed +)?char *$") - var_target_char[n_target_char++] = otype name; + var_target_char[n_target_char++] = otype "x_" name; else - var_target_other[n_target_other++] = otype name; + var_target_other[n_target_other++] = otype "x_" name; } } } else { - var_target_int[n_target_int++] = "int target_flags"; + var_target_int[n_target_int++] = "int x_target_flags"; } for (i = 0; i < n_target_other; i++) { diff --git a/gcc/opts.c b/gcc/opts.c index ef379428027..ff59fd2fa12 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -123,6 +123,11 @@ static enum debug_struct_file debug_struct_ordinary[DINFO_USAGE_NUM_ENUMS] static enum debug_struct_file debug_struct_generic[DINFO_USAGE_NUM_ENUMS] = { DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY, DINFO_STRUCT_FILE_ANY }; +/* Run the second compilation of -fcompare-debug. Not defined using + Var in common.opt because this is used in Ada code and so must be + an actual variable not a macro. */ +int flag_compare_debug; + /* Parse the -femit-struct-debug-detailed option value and set the flag variables. */ @@ -1635,7 +1640,7 @@ common_handle_option (const struct cl_decoded_option *decoded, break; case OPT_Wsystem_headers: - global_dc->warn_system_headers = value; + global_dc->dc_warn_system_headers = value; break; case OPT_Wunused: @@ -1700,6 +1705,10 @@ common_handle_option (const struct cl_decoded_option *decoded, fix_register (arg, 0, 0); break; + case OPT_fcompare_debug_second: + flag_compare_debug = value; + break; + case OPT_fdbg_cnt_: dbg_cnt_process_opt (arg); break; @@ -2083,7 +2092,7 @@ common_handle_option (const struct cl_decoded_option *decoded, break; case OPT_w: - global_dc->inhibit_warnings = true; + global_dc->dc_inhibit_warnings = true; break; case OPT_fuse_linker_plugin: @@ -2186,11 +2195,11 @@ fast_math_flags_set_p (void) bool fast_math_flags_struct_set_p (struct cl_optimization *opt) { - return (!opt->flag_trapping_math - && opt->flag_unsafe_math_optimizations - && opt->flag_finite_math_only - && !opt->flag_signed_zeros - && !opt->flag_errno_math); + return (!opt->x_flag_trapping_math + && opt->x_flag_unsafe_math_optimizations + && opt->x_flag_finite_math_only + && !opt->x_flag_signed_zeros + && !opt->x_flag_errno_math); } /* Handle a debug output -g switch. EXTENDED is true or false to support diff --git a/gcc/reginfo.c b/gcc/reginfo.c index 879f50b0825..c8192dec0e9 100644 --- a/gcc/reginfo.c +++ b/gcc/reginfo.c @@ -1,7 +1,7 @@ /* Compute different info about registers. Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -487,7 +487,7 @@ init_reg_sets_1 (void) } else if (i == FRAME_POINTER_REGNUM) ; -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER else if (i == HARD_FRAME_POINTER_REGNUM) ; #endif diff --git a/gcc/regrename.c b/gcc/regrename.c index 191e3b4278f..2535ab74ab9 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -200,7 +200,7 @@ regrename_optimize (void) if (frame_pointer_needed) { add_to_hard_reg_set (&unavailable, Pmode, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER add_to_hard_reg_set (&unavailable, Pmode, HARD_FRAME_POINTER_REGNUM); #endif } @@ -233,7 +233,7 @@ regrename_optimize (void) #endif if (fixed_regs[reg] || global_regs[reg] -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER || (frame_pointer_needed && reg == HARD_FRAME_POINTER_REGNUM) #else || (frame_pointer_needed && reg == FRAME_POINTER_REGNUM) diff --git a/gcc/reload.c b/gcc/reload.c index 2df18a1dc59..e396e2537af 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1,6 +1,6 @@ /* Search an insn for pseudo regs that must be in hard regs and are not. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -5157,7 +5157,7 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad, if ((regno_ok_for_base_p (REGNO (operand), mode, inner_code, GET_CODE (addend)) || operand == frame_pointer_rtx -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER || operand == hard_frame_pointer_rtx #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM diff --git a/gcc/reload1.c b/gcc/reload1.c index 38b90835592..1024cf1688c 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -831,7 +831,7 @@ reload (rtx first, int global) spill_hard_reg (from, 1); } -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER if (frame_pointer_needed) spill_hard_reg (HARD_FRAME_POINTER_REGNUM, 1); #endif @@ -3232,7 +3232,7 @@ eliminate_regs_in_insn (rtx insn, int replace) for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->from_rtx == SET_DEST (old_set) && ep->can_eliminate) { -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER /* If this is setting the frame pointer register to the hardware frame pointer register and this is an elimination that will be done (tested above), this insn is really diff --git a/gcc/resource.c b/gcc/resource.c index 4917273b7f6..6a33ed0bf9d 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -1,6 +1,6 @@ /* Definitions for computing resource usage of specific insns. Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009 Free Software Foundation, Inc. + 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -335,7 +335,7 @@ mark_referenced_resources (rtx x, struct resources *res, if (frame_pointer_needed) { SET_HARD_REG_BIT (res->regs, FRAME_POINTER_REGNUM); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER SET_HARD_REG_BIT (res->regs, HARD_FRAME_POINTER_REGNUM); #endif } @@ -1148,7 +1148,7 @@ init_resource_info (rtx epilogue_insn) if (frame_pointer_needed) { SET_HARD_REG_BIT (end_of_function_needs.regs, FRAME_POINTER_REGNUM); -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM); #endif if (! EXIT_IGNORE_STACK diff --git a/gcc/rtl.h b/gcc/rtl.h index 24a735ffa51..3aba4735642 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1980,6 +1980,16 @@ extern GTY(()) rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE]; #define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM #endif +#ifndef HARD_FRAME_POINTER_IS_FRAME_POINTER +#define HARD_FRAME_POINTER_IS_FRAME_POINTER \ + (HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM) +#endif + +#ifndef HARD_FRAME_POINTER_IS_ARG_POINTER +#define HARD_FRAME_POINTER_IS_ARG_POINTER \ + (HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM) +#endif + /* Index labels for global_rtl. */ enum global_rtl_index { @@ -1993,13 +2003,13 @@ enum global_rtl_index #if FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM GR_ARG_POINTER = GR_FRAME_POINTER, #endif -#if HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM +#if HARD_FRAME_POINTER_IS_FRAME_POINTER GR_HARD_FRAME_POINTER = GR_FRAME_POINTER, #else GR_HARD_FRAME_POINTER, #endif #if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM -#if HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM +#if HARD_FRAME_POINTER_IS_ARG_POINTER GR_ARG_POINTER = GR_HARD_FRAME_POINTER, #else GR_ARG_POINTER, diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 041c471b94c..0e0c7c82d1c 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -1236,7 +1236,7 @@ mark_unavailable_hard_regs (def_t def, struct reg_rename *reg_rename_p, frame pointer, or we could not discover its class. */ if (fixed_regs[regno] || global_regs[regno] -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER || (frame_pointer_needed && regno == HARD_FRAME_POINTER_REGNUM) #else || (frame_pointer_needed && regno == FRAME_POINTER_REGNUM) @@ -1263,7 +1263,7 @@ mark_unavailable_hard_regs (def_t def, struct reg_rename *reg_rename_p, SET_HARD_REG_BIT (reg_rename_p->unavailable_hard_regs, FRAME_POINTER_REGNUM + i); -#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_FRAME_POINTER for (i = hard_regno_nregs[HARD_FRAME_POINTER_REGNUM][Pmode]; i--;) SET_HARD_REG_BIT (reg_rename_p->unavailable_hard_regs, HARD_FRAME_POINTER_REGNUM + i); diff --git a/gcc/stmt.c b/gcc/stmt.c index ccf5c54320c..21aab7aa017 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1834,7 +1834,7 @@ expand_nl_goto_receiver (void) decrementing fp by STARTING_FRAME_OFFSET. */ emit_move_insn (virtual_stack_vars_rtx, hard_frame_pointer_rtx); -#if ARG_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM +#if !HARD_FRAME_POINTER_IS_ARG_POINTER if (fixed_regs[ARG_POINTER_REGNUM]) { #ifdef ELIMINABLE_REGS diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 6771e1f942d..3b6f4fae9d8 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,17 @@ +2010-09-29 Joseph Myers + + * include/cpplib.h (cpp_options): Rename warn_deprecated, + warn_traditional, warn_long_long and pedantic. + * directives.c (directive_diagnostics, _cpp_handle_directive): + Update names of cpp_options members. + * expr.c (cpp_classify_number, eval_token): Update names of + cpp_options members. + * init.c (cpp_create_reader, post_options): Update names of + cpp_options members. + * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of + cpp_options members. + * macro.c (parse_params): Update names of cpp_options members. + 2010-09-15 Ian Lance Taylor * init.c: Fix type name in comment. diff --git a/libcpp/directives.c b/libcpp/directives.c index 997737bd4da..3d128554c12 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -354,7 +354,7 @@ directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented) cpp_error (pfile, CPP_DL_PEDWARN, "#%s is a GCC extension", dir->name); else if (((dir->flags & DEPRECATED) != 0 || (dir == &dtable[T_IMPORT] && !CPP_OPTION (pfile, objc))) - && CPP_OPTION (pfile, warn_deprecated)) + && CPP_OPTION (pfile, cpp_warn_deprecated)) cpp_warning (pfile, CPP_W_DEPRECATED, "#%s is a deprecated GCC extension", dir->name); } @@ -400,7 +400,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented) if (was_parsing_args) { - if (CPP_OPTION (pfile, pedantic)) + if (CPP_OPTION (pfile, cpp_pedantic)) cpp_error (pfile, CPP_DL_PEDWARN, "embedding a directive within macro arguments is not portable"); pfile->state.parsing_args = 0; diff --git a/libcpp/expr.c b/libcpp/expr.c index d2f6c3cf0ac..d2fec2a56a6 100644 --- a/libcpp/expr.c +++ b/libcpp/expr.c @@ -418,7 +418,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) { int u_or_i = (result & (CPP_N_UNSIGNED|CPP_N_IMAGINARY)); int large = (result & CPP_N_WIDTH) == CPP_N_LARGE - && CPP_OPTION (pfile, warn_long_long); + && CPP_OPTION (pfile, cpp_warn_long_long); if (u_or_i || large) cpp_warning (pfile, large ? CPP_W_LONG_LONG : CPP_W_TRADITIONAL, @@ -427,7 +427,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token) } if ((result & CPP_N_WIDTH) == CPP_N_LARGE - && CPP_OPTION (pfile, warn_long_long)) + && CPP_OPTION (pfile, cpp_warn_long_long)) { const char *message = CPP_OPTION (pfile, cplusplus) ? N_("use of C++0x long long integer constant") @@ -814,7 +814,7 @@ eval_token (cpp_reader *pfile, const cpp_token *token) if (CPP_PEDANTIC (pfile)) cpp_error (pfile, CPP_DL_PEDWARN, "assertions are a GCC extension"); - else if (CPP_OPTION (pfile, warn_deprecated)) + else if (CPP_OPTION (pfile, cpp_warn_deprecated)) cpp_warning (pfile, CPP_W_DEPRECATED, "assertions are a deprecated extension"); } diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 87d368e2925..7c39a83b875 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -319,7 +319,7 @@ struct cpp_options unsigned char print_include_names; /* Nonzero means complain about deprecated features. */ - unsigned char warn_deprecated; + unsigned char cpp_warn_deprecated; /* Nonzero means warn if slash-star appears in a comment. */ unsigned char warn_comments; @@ -336,10 +336,10 @@ struct cpp_options /* Nonzero means warn about various incompatibilities with traditional C. */ - unsigned char warn_traditional; + unsigned char cpp_warn_traditional; /* Nonzero means warn about long long numeric constants. */ - unsigned char warn_long_long; + unsigned char cpp_warn_long_long; /* Nonzero means warn about text after an #endif (or #else). */ unsigned char warn_endif_labels; @@ -383,7 +383,7 @@ struct cpp_options unsigned char std; /* Nonzero means give all the error messages the ANSI standard requires. */ - unsigned char pedantic; + unsigned char cpp_pedantic; /* Nonzero means we're looking at already preprocessed code, so don't bother trying to do macro expansion and whatnot. */ diff --git a/libcpp/init.c b/libcpp/init.c index 1a0a64f2b58..cfc16e8f8d4 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -160,8 +160,8 @@ cpp_create_reader (enum c_lang lang, hash_table *table, CPP_OPTION (pfile, operator_names) = 1; CPP_OPTION (pfile, warn_trigraphs) = 2; CPP_OPTION (pfile, warn_endif_labels) = 1; - CPP_OPTION (pfile, warn_deprecated) = 1; - CPP_OPTION (pfile, warn_long_long) = 0; + CPP_OPTION (pfile, cpp_warn_deprecated) = 1; + CPP_OPTION (pfile, cpp_warn_long_long) = 0; CPP_OPTION (pfile, dollars_in_ident) = 1; CPP_OPTION (pfile, warn_dollars) = 1; CPP_OPTION (pfile, warn_variadic_macros) = 1; @@ -698,7 +698,7 @@ post_options (cpp_reader *pfile) { /* -Wtraditional is not useful in C++ mode. */ if (CPP_OPTION (pfile, cplusplus)) - CPP_OPTION (pfile, warn_traditional) = 0; + CPP_OPTION (pfile, cpp_warn_traditional) = 0; /* Permanently disable macro expansion if we are rescanning preprocessed text. Read preprocesed source in ISO mode. */ diff --git a/libcpp/internal.h b/libcpp/internal.h index 9209b55def0..e0ac285d82c 100644 --- a/libcpp/internal.h +++ b/libcpp/internal.h @@ -1,6 +1,6 @@ /* Part of CPP library. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, - 2008, 2009 Free Software Foundation, Inc. + 2008, 2009, 2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -526,8 +526,8 @@ cpp_in_system_header (cpp_reader *pfile) { return pfile->buffer ? pfile->buffer->sysp : 0; } -#define CPP_PEDANTIC(PF) CPP_OPTION (PF, pedantic) -#define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, warn_traditional) +#define CPP_PEDANTIC(PF) CPP_OPTION (PF, cpp_pedantic) +#define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, cpp_warn_traditional) static inline int cpp_in_primary_file (cpp_reader *); static inline int diff --git a/libcpp/macro.c b/libcpp/macro.c index 31de4156c64..d9324a350ef 100644 --- a/libcpp/macro.c +++ b/libcpp/macro.c @@ -1,7 +1,7 @@ /* Part of CPP library. (Macro and #define handling.) Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Written by Per Bothner, 1994. Based on CCCP program by Paul Rubin, June 1986 Adapted to ANSI C, Richard Stallman, Jan 1987 @@ -1589,13 +1589,13 @@ parse_params (cpp_reader *pfile, cpp_macro *macro) pfile->spec_nodes.n__VA_ARGS__); pfile->state.va_args_ok = 1; if (! CPP_OPTION (pfile, c99) - && CPP_OPTION (pfile, pedantic) + && CPP_OPTION (pfile, cpp_pedantic) && CPP_OPTION (pfile, warn_variadic_macros)) cpp_pedwarning (pfile, CPP_W_VARIADIC_MACROS, "anonymous variadic macros were introduced in C99"); } - else if (CPP_OPTION (pfile, pedantic) + else if (CPP_OPTION (pfile, cpp_pedantic) && CPP_OPTION (pfile, warn_variadic_macros)) cpp_pedwarning (pfile, CPP_W_VARIADIC_MACROS, "ISO C does not permit named variadic macros");