aboutsummaryrefslogtreecommitdiff
path: root/gcc/common.opt
AgeCommit message (Collapse)AuthorFilesLines
2006-12-07common.opt (record-gcc-switches): New command line switch.Nick Clifton1-0/+10
* common.opt (record-gcc-switches): New command line switch. * target.h (print_switch_type): New enum. (print_switch_fn_type): New typedef for a function pointer. (struct gcc_target): Add record_gcc_switches and record_gcc_switches_section fields. * target-def.h (TARGET_ASM_RECORD_GCC_SWITCHES): Provide a default definition. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Provide a default definition. * toplev.c (print_single_switch): Simplify by providing a pointer to function that will format and output the switch appropriately. (print_switch_values): Likewise. (print_to_asm_out_file): New function. (print_to_stderr): New function. (init_asm_output): If flag_record_gcc_switches is set then if the target supports recording the switches then emit them into the assembler output file, otherwise tell the user that the switch is not supported. * varasm.c (eld_record_gcc_switches): New function. Example handler for the record_gcc_switches target hook. * doc/tm.texi (TARGET_ASM_RECORD_GCC_SWITCHES): Document the new target hook. (TARGET_ASM_RECORD_GCC_SWITCHES_SECTION): Likewise. * doc/invoke.texi (-frecord-gcc-switches): Document. From-SVN: r119615
2006-12-01common.opt (ftree-combine-temps): Remove.Andrew MacLeod1-4/+0
* common.opt (ftree-combine-temps): Remove. * tree-outof-ssa.c (SSANORM_COMBINE_TEMPS): Remove. (coalesce_ssa_name): Don't check for combine-temps. (coalesce_vars): Remove. (check_replaceable): Use num_imm_uses. (remove_ssa_form, insert_backedge_copies, rewrite_out_of_ssa): Don't check for combine-temps. (rewrite_out_of_ssa): Never create a ref_count in the var_map. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Change parms to register_ssa_partition calls. * tree-ssa-live.c (register_ssa_partition): Remove prototype. (init_var_map, delete_var_map): remove refernces to ref_count. (create_ssa_var_map): Never calculate a ref count. (type_var_init): Remove. * tree-ssa-live.h (typedef struct _var_map): Remove ref_count. (SSA_VAR_MAP_REF_COUNT): Delete. (create_ssa_var_map): Change Prototype to have no parameters. (version_ref_count): Delete. (register_ssa_partition): Remove 'is_use' paramater and don't set the ref_count vector. (type_var_num, type_var, type_var_first_partition, type_var_next_partition, type_var_dump, type_var_delete, type_var_remove_partition, type_var_find, type_var_compact, type_var_decompact): Remove. * gcc.dg/max-1.c: Remove reference to -fno-tree-lrs option. From-SVN: r119409
2006-11-04fwprop.c: New file.Paolo Bonzini1-0/+4
2006-11-03 Paolo Bonzini <bonzini@gnu.org> Steven Bosscher <stevenb.gcc@gmail.com> * fwprop.c: New file. * Makefile.in: Add fwprop.o. * tree-pass.h (pass_rtl_fwprop, pass_rtl_fwprop_with_addr): New. * passes.c (init_optimization_passes): Schedule forward propagation. * rtlanal.c (loc_mentioned_in_p): Support NULL value of the second parameter. * timevar.def (TV_FWPROP): New. * common.opt (-fforward-propagate): New. * opts.c (decode_options): Enable forward propagation at -O2. * gcse.c (one_cprop_pass): Do not run local cprop unless touching jumps. * cse.c (fold_rtx_subreg, fold_rtx_mem, fold_rtx_mem_1, find_best_addr, canon_for_address, table_size): Remove. (new_basic_block, insert, remove_from_table): Remove references to table_size. (fold_rtx): Process SUBREGs and MEMs with equiv_constant, make simplification loop more straightforward by not calling fold_rtx recursively. (equiv_constant): Move here a small part of fold_rtx_subreg, do not call fold_rtx. Call avoid_constant_pool_reference to process MEMs. * recog.c (canonicalize_change_group): New. * recog.h (canonicalize_change_group): New. * doc/invoke.texi (Optimization Options): Document fwprop. * doc/passes.texi (RTL passes): Document fwprop. Co-Authored-By: Steven Bosscher <stevenb.gcc@gmail.com> From-SVN: r118475
2006-07-17re PR other/28251 (dumped addresses makes diffing dumps unusable)J"orn Rennecke1-1/+5
gcc: PR other/28251 * tree.h (dump_addr): Declare. * print-tree.c (dump_addr): New function. (print_node_brief, print_node): Use it. * print-rtl.c (print_rtx): Likewise. * common.opt (-fdump-noaddr): New option. * doc/invoke.texi (-fdump-noaddr): Document. * loop-unroll.c (si_info_hash): Make hash independent of addresses. (ve_info_hash): Likewise. gcc/testsuite: PR other/28251 gcc.c-torture/unsorted/dump-noaddr.c: New test. gcc.c-torture/unsorted/dump-noaddr.x: New driver. From-SVN: r115519
2006-05-18Whitespace fixupsMike Stump1-4/+4
From-SVN: r113893
2006-05-16re PR target/26885 (-m64 -m32 no longer creates 32-bit object)H.J. Lu1-7/+7
gcc/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Makefile.in (GCC_OBJS): New. (OBJS-common): Add opts-common.o. (xgcc$(exeext)): Replace gcc.o with $(GCC_OBJS). (cpp$(exeext)): Likewise. (gcc.o): Also depend on opts.h. (opts-common.o): New. * common.opt (gcoff): Add Negative(gdwarf-2). (gdwarf-2): Add Negative(gstabs). (gstabs): Add Negative(gstabs+). (gstabs+): Add Negative(gvms). (gvms): Add Negative(gxcoff). (gxcoff): Add Negative(gxcoff+). (gxcoff+): Add Negative(gcoff). * config/i386/i386.opt (m32): Add Negative(m64). (m64): Add Negative(m32). * doc/options.texi: Document the Negative option. * gcc.c: Include "opts.h". (main): Call prune_options after expandargv. * optc-gen.awk: Generate common declarations for all flag variables in options.c. Output the neg_index field. * opts.c (find_opt): Moved to ... * opts-common.c: Here. New file. * opts.h (cl_option): Add a neg_index field. (find_opt): New. (prune_options): Likewise. gcc/cp/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GXX_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/fortran/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (GFORTRAN_D_OBJS): Replace gcc.o with $(GCC_OBJS). gcc/java/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in ($(GCJ)$(exeext)): Replace gcc.o with $(GCC_OBJS). gcc/treelang/ 2006-05-16 H.J. Lu <hongjiu.lu@intel.com> PR driver/26885 * Make-lang.in (gtreelang$(exeext)): Replace gcc.o with $(GCC_OBJS). From-SVN: r113824
2006-05-04[multiple changes]Razya Ladelsky1-0/+4
2006-05-04 Leehod Baruch <leehod@il.ibm.com> * see.c: New file. * Makefile.in (OBJS-common): Add see.o. (see.o): Add dependencies. * common.opt (fsee): New flag for the see optimization was added. * opts.c (flag_see): Initialized. * passes.c (init_optimization_passes, pass_see): New pass. * rtl.h (see_main): Declaration as extern. * timevar.def (TV_SEE): New. * tree-pass.h (pass_see): Declaration as extern. * invoke.texi (-fsee): Document. * recog.c (validate_simplify_insn): New function. * recog.h (validate_simplify_insn): Declaration as extern. * df-problems.c (df_chain_dump): Check for NULL. 2006-05-04 Kenneth Zadeck <zadeck@naturalbridge.com> Daniel Berlin <dberlin@dberlin.org> * cfgrtl.c (insert_insn_bb_end_new): New function. * basic-block.h (insert_insn_bb_end_new): Declaration as extern. 2006-05-04 Leehod Baruch <leehod.baruch@weizmann.ac.il> * df.h (struct web_entry): Moved from web.c. (union_defs): Declaration as extern. (unionfind_root): Likewise. (unionfind_union): Likewise. * web.c (struct web_entry): Moved to df.h. (unionfind_root): Remove static declaration. (unionfind_union): Likewise. (union_defs): Likewise and generalize to use callback function. (web_main): Update arguments for union_defs function call. From-SVN: r113518
2006-05-01common.opt (Woverflow): New command line option.Roger Sayle1-0/+4
* common.opt (Woverflow): New command line option. * c-common.c (constant_expression_warning): Check warn_overflow. (overflow_waring): Pass OPT_Woverflow to warning. (unsigned_conversion_warning): Likewise. (convert_and_check): Likewise. * doc/invoke.texi: Document new command line option. * gcc.dg/Woverflow-1.c: New test case. * gcc.dg/Woverflow-2.c: Likewise. * gcc.dg/Woverflow-3.c: Likewise. From-SVN: r113408
2006-04-22re PR libmudflap/26864 (multithreaded mudflap not working)Frank Ch. Eigler1-1/+1
2006-04-22 Frank Ch. Eigler <fche@redhat.com> PR libmudflap/26864 * common.opt (flag_mudflap_threads): Overload flag_mudflap. * tree-mudflap.c (flag_mudflap_threads): Derive from flag_mudflap. From-SVN: r113179
2006-03-24invoke.texi: Document -femit-class-debug-alwaysCarlos O'Donell1-0/+4
gcc/ 2006-03-24 Carlos O'Donell <carlos@codesourcery.com> * doc/invoke.texi: Document -femit-class-debug-always * common.opt: Add -femit-class-debug-always. gcc/cp/ 2006-03-24 Carlos O'Donell <carlos@codesourcery.com> * search.c (maybe_suppress_debug_info): If flag_emit_class_debug_always then don't suppress. From-SVN: r112360
2006-03-21options.c (gfc_init_options): Initialize flag_argument_noalias to 3.Toon Moene1-1/+7
2006-03-21 Toon Moene <toon@moene.indiv.nluug.nl> * fortran/options.c (gfc_init_options): Initialize flag_argument_noalias to 3. * doc/invoke.texi: Document new flag -fargument-noalias-anything. * tree-ssa-alias.c (may_alias_p): If flag_argument_noalias > 2, argument pointers may not alias any other storage. * common.opt: Define option -fargument-noalias-anything. * tree-ssa-structalias.c (intra_create_variable_infos): Fortran alias semantics is specified by flag_argument_noalias > 2. From-SVN: r112243
2006-03-04builtins.c, [...]: Fix comment typos.Kazu Hirata1-3/+3
* builtins.c, c-pragma.h, c-typeck.c, cgraph.c, cgraphunit.c, combine.c, common.opt, config/dfp-bit.c, config/i386/i386.c, config/m68k/m68k.c, config/m68k/m68k.md, config/mt/mt.c, config/mt/mt.h, config/s390/s390.md, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, expr.c, function.h, gimplify.c, loop-invariant.c, omp-low.c, opts.c, passes.c, rtl-factoring.c, rtlanal.c, struct-equiv.c, tree-cfgcleanup.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-vect-patterns.c, tree-vect-transform.c, tree-vectorizer.h, tree-vrp.c, unwind-dw2.c: Fix comment typos. Follow spelling conventions. From-SVN: r111721
2006-02-27opts.c (decode_options): Do not handle flag_strength_reduce.Zdenek Dvorak1-7/+11
* opts.c (decode_options): Do not handle flag_strength_reduce. (common_handle_option): Handle OPT_floop_optimize, OPT_frerun_loop_opt and OPT_fstrength_reduce. * tree-ssa-loop.c (tree_ssa_loop_prefetch): Only test flag_prefetch_loop_arrays for being nonzero. * common.opt (floop-optimize, frerun-loop-opt): Resurrected as no-ops. (fprefetch-loop-arrays-rtl): Removed. (flag_prefetch_loop_arrays): Do not specify the value. * doc/passes.texi: Update documentation of loop optimizer passes. * doc/invoke.texi (-fstrength-reduce, -fprefetch-loop-arrays-rtl, -frerun-loop-opt): Remove. * gcc.target/i386/20000614-2.c: Do not use -fno-strength-reduce. * gcc.dg/20030324-1.c: Do not use -fstrength-reduce. From-SVN: r111469
2006-02-26common.opt (-floop-optimize, [...]): Remove.Steven Bosscher1-8/+0
gcc/ * common.opt (-floop-optimize, -frerun-loop-opt): Remove. * tree-pass.h (pass_loop_optimize): Remove. * passes.c (pass_loop_optimize): Never run it. * toplev.c (backend_init): Don't call init_loop. * opts.c (flag_loop_optimize_set): Remove. (decode_options): Never set flag_loop_optimize or flag_rerun_loop_opt. (common_handle_option) <OPT_floop_optimize>: Remove. Don't disable the old RTL loop optimizer when profiling enabled. * predict.c (tree_estimate_probability): Always strip builtin_expect. * cfgcleanup.c (try_forward_edges): Don't avoid killing loop pre-headers for the sake of the old RTL loop optimizer. * Makefile.in: Remove all references to loop.o. * doc/invoke.texi: Remove all references to -floop-optimize and -frerun-loop-opt. testsuite/ * gcc.dg/20031201-1.c: Don't use -frerun-loop-opt. * g++.old-deja/g++.robertl/eb132.C: Likewise. From-SVN: r111459
2006-02-21* doc/tm.texi (ASM_OUTPUT_SHARED_COMMON, ASM_OUTPUT_SHARED_BSS)Richard Sandiford1-4/+0
(ASM_OUTPUT_SHARED_LOCAL): Delete. * doc/invoke.texi (-fshared-data): Delete. * common.opt (fshared-data): Delete. * varasm.c (asm_emit_uninitialised): Remove flag_shared_data handling. (assemble_static_space): Remove #if 0 code. * system.h (ASM_OUTPUT_SHARED_COMMON, ASM_OUTPUT_SHARED_BSS) (ASM_OUTPUT_SHARED_LOCAL): Poison. * config/cris/cris.h: Remove FIXME. From-SVN: r111330
2006-02-19invoke.texi: Document -fipa-pta.Daniel Berlin1-0/+4
2006-02-19 Daniel Berlin <dberlin@dberlin.org> * doc/invoke.texi: Document -fipa-pta. * common.opt: Add ipa-pta option. * tree-ssa-structalias.c (DONT_PROPAGATE_WITH_ANYTHING): Removed. (do_sd_constraint): Enable DONT_PROPAGATE_WITH_ANYTHING code. (do_ds_constraint): Ditto. (get_constraint_for): Only add to referenced_vars if referenced_vars exists. (insert_into_field_list): Rewrite to do this unsorted. (insert_into_field_list_sorted): Rename old insert_into_field_list to this. (create_function_info_for): Use insert_into_field_list_sorted. (create_variable_info_for): Rewrite so it uses unsorted version, since the field list is sorted. (intra_create_variable_infos): Only add to referenced_vars if referenced_vars exists. (ipa_pta_execute): Init heapvars, and delete when done. * passes.c (init_optimization_passes): Add call to pass_ipa_pta. From-SVN: r111273
2006-02-18re PR target/9703 ([arm] Accessing data through constant pool more times ↵Richard Sandiford1-0/+4
could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-14invoke.texi (-fprefetch-loop-arrays, [...]): Document.Zdenek Dvorak1-1/+5
* doc/invoke.texi (-fprefetch-loop-arrays, -fprefetch-loop-arrays-rtl): Document. * tree-ssa-loop-niter.c (number_of_iterations_ne, number_of_iterations_lt, number_of_iterations_cond): Remember the shape of the ending condition. * tree-ssa-loop-manip.c: Include params.h. (build_if_stmt, can_unroll_loop_p, determine_exit_conditions, tree_unroll_loop): New functions. * tree-pass.h (pass_loop_prefetch): Declare. * loop.c (rest_of_handle_loop_optimize): Test for -fprefetch-loop-arrays-rtl. * tree-scalar-evolution.h (affine_iv): Moved to tree-flow.h. * timevar.def (TV_TREE_PREFETCH): New timevar. * tree-ssa-loop.c (tree_ssa_loop_prefetch, gate_tree_ssa_loop_prefetch, pass_loop_prefetch): New. * tree-cfgcleanup.c: Include tree-scalar-evolution.h. (cleanup_tree_cfg_loop): Call scev_reset. * common.opt (fprefetch-loop-arrays-rtl): Add. * tree-ssa-loop-prefetch.c: New file. * tree-outof-ssa.c (struct value_expr_d): Add expr_vars field. (new_temp_expr_table): Initialize expr_vars. (free_temp_expr_table): Cleanup expr_vars. (check_replaceable, find_replaceable_in_bb): Prevent accumulating expressions from being merged into one. * tree-flow.h (affine_iv): Moved from tree-scalar-evolution.h. (struct tree_niter_desc): Add control, bound and cmp fields. (tree_ssa_prefetch_arrays, can_unroll_loop_p, tree_unroll_loop): Declare. * Makefile.in (tree-ssa-loop-prefetch.o): Add. (tree-cfgcleanup.o): Add SCEV_H dependency. (tree-ssa-loop-manip.o): Add PARAMS_H dependency. * passes.c (init_optimization_passes): Add pass_loop_prefetch. From-SVN: r110964
2006-02-10invoke.texi (-floop-optimize2): Removed.Zdenek Dvorak1-5/+1
* doc/invoke.texi (-floop-optimize2): Removed. * toplev.c (process_options): Remove handling of flag_loop_optimize2. * loop-init.c (gate_handle_loop2): Do not test flag_loop_optimize2. Test flag_branch_on_count_reg only if HAVE_doloop_end. * common.opt (floop-optimize2): Removed. (fmove-loop-invariants): Enabled by default. * gcc.dg/20050105-1.c: Do not use -floop-optimize2. From-SVN: r110852
2006-01-18c-pragma.c (handle_pragma_diagnostic): New.DJ Delorie1-1/+5
* c-pragma.c (handle_pragma_diagnostic): New. (init_pragma): Register it. * doc/extend.texi: Document it. * diagnostic.def: Add DK_UNSPECIFIED and DK_IGNORED. * diagnostic.h (diagnostic_classify_diagnostic): Declare. (diagnostic_context): Add classify_diagnostic[]. * diagnostic.c (diagnostic_count_diagnostic): Don't count warnings as errors if they're overridden to DK_WARNING. (diagnostic_initialize): Initialize classify_diagnostic[]. (diagnostic_set_kind_override): New. (diagnostic_report_diagnostic): Check for kind changes. * opts.c (common_handle_option): Take lang_mask. Update callers. Handle OPT_Werror_. * common.opt (Werror=): New. * doc/invoke.texi: Document -Werror=* From-SVN: r109907
2006-01-17common.opt (ftoplevel-reorder): New option.Ian Lance Taylor1-0/+4
./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-16rtl-factoring.c: Add sequence abstraction algorithm.Gabor Loki1-0/+4
2006-01-16 Gabor Loki <loki@gcc.gnu.org> * rtl-factoring.c : Add sequence abstraction algorithm. * cfgcleanup.c (outgoing_edges_match): Extra checks. (try_crossjump_to_edge): Avoid deleting preserve label when redirecting ABNORMAL edges. (block_has_preserve_label): New function. * common.opt: Register new pass. * Makefile.in: Ditto. * passes.c: Ditto. * timevar.def: Ditto. * tree-pass.h: Ditto. * emit-rtl.c (make_jump_insn_raw): Remove forward decl. * rtl.h (make_jump_insn_raw): Add forward decl. * doc/invoke.texi: Add documentation for -frtl-abstract-sequences. From-SVN: r109750
2005-12-14c-common.c (c_common_truthvalue_conversion): Generalise warning for ↵Ben Elliston1-0/+4
addresses converted to booleans; not just function addresses. * c-common.c (c_common_truthvalue_conversion): Generalise warning for addresses converted to booleans; not just function addresses. * c-typeck.c (build_binary_op): Warn for address comparisons which can never be NULL (eg. func == NULL or &var == NULL). * common.opt (Walways-true): New option. * c-opts.c (c_common_handle_option): Set it with -Wall. * doc/invoke.texi: Document it. testsuite/ * gcc.dg/warn-addr-cmp.c: New test. From-SVN: r108489
2005-12-04re PR c/7776 (const char* p = "foo"; if (p == "foo") ... is compiled without ↵Roger Sayle1-0/+4
warning!) PR c/7776 * common.opt (Wstring-literal-comparison): New command line option. * c-opts.c (c_common_handle_option): Set it with -Wall. * c-typeck.c (parser_build_binary_op): Issue warning if either operand of a comparison operator is a string literal, except for testing equality or inequality against NULL. * doc/invoke.texi: Document new -Wstring-literal-comparison option. * gcc.dg/Wstring-literal-comparison-1.c: New test case. * gcc.dg/Wstring-literal-comparison-2.c: Likewise. * gcc.dg/Wstring-literal-comparison-3.c: Likewise. * gcc.dg/Wstring-literal-comparison-4.c: Likewise. From-SVN: r108018
2005-11-11re PR c/24644 (gcc-4.1 compiled ppc64 kernels do not boot)David Edelsohn1-0/+4
PR 24644 * common.opt (Wvolatile-register-var): New. * varasm.c (make_decl_rtl): Only emit warning when option specified. Clarify warning message. * doc/invoke.texi (Wvolatile-register-var): Document new option. * doc/md.texi (copysign): Document standard named pattern. From-SVN: r106791
2005-09-06common.opt: Add option ftree-vect-loop-version.Keith Besaw1-0/+4
* common.opt: Add option ftree-vect-loop-version. * params.def: Add --param vect-max-version-checks. * doc/invoke.texi: Document ftree-vect-loop-version and --param vect-max-version-checks. * tree-vectorizer.h (_loop_vec_info): Add ptr_mask and may_misalign_stmts and defines for accessors. * tree-vectorizer.c : (new_loop_vec_info): VEC_alloc for LOOP_VINFO_MAY_MISALIGN_STMTS. (destroy_loop_vec_info): VEC_free for LOOP_VINFO_MAY_MISALIGN_STMTS. * tree-vect-analyze.c (vect_compute_data_ref_alignment): Update documentation. (vect_update_misalignment_for_peel): New. (vect_enhance_data_refs_alignment): Update to choose loop peeling or loop versioning if appropriate for the (potentially) unaligned data references in the loop. (vect_analyze_data_refs_alignment): Remove call to vect_enhance_data_refs_alignment so the checks can be done earlier. (vect_analyze_loop): Add call to vect_enhance_data_refs_alignment and move up call to vect_analyze_data_refs_alignment. * tree-vect-transform.c (vect_create_cond_for_align_checks): New. (vect_transform_loop): Add call to loop_version. From-SVN: r103941
2005-09-01re PR tree-optimization/15366 ([3.4 only][unit-at-a-time] ↵Richard Guenther1-3/+7
-fno-inline-functions is ignored for static functions) 2005-09-01 Richard Guenther <rguenther@suse.de> PR tree-optimization/15366 * common.opt: Add -finline-functions-called-once. Put -fearly-inlining in alphabetically ordered place. * doc/invoke.texi: Document new option. * ipa-inline.c (cgraph_decide_inlining): Honour flag_inline_functions_called_once. From-SVN: r103722
2005-08-01common.opt (flag_ipa_cp): Put in right place to maintain alphabetic sort.Steven Bosscher1-4/+4
* common.opt (flag_ipa_cp): Put in right place to maintain alphabetic sort. From-SVN: r102631
2005-08-01Makefile.in: Add ipcp.c, ipa-prop.h, ipa-prop.c.Razya Ladelsky1-0/+4
* Makefile.in: Add ipcp.c, ipa-prop.h, ipa-prop.c. Remove integrate.h dependency from tree-inline.o. Add ipa-prop.h dependency to tree-inline.o and cgraphunit.o. * common.opt: Add ipa-cp flag. * timevar.def: Add IPCP optimization. * tree-optimize.c (init_tree_optimization_passes): Schedule pass_ipa_cp. * tree-pass.h (pass_ipa_cp): Declare. * cgraph.h (update_call_expr, cgraph_copy_node_for_versioning, cgraph_function_versioning): New declarations. * cgraphunit.c: Add include to ipa-prop.h. (update_call_expr, cgraph_copy_node_for_versioning, cgraph_function_versioning): New functions. * integrate.c (copy_decl_for_inlining): Remove. * tree-inline.c: Remove include to integrate.h, Add include ipa-prop.h. (struct inline_data): Add versioning_p, ipa_info, new fields. (remap_decl, mark_local_for_remap_r, setup_one_parameter, declare_return_variable): Replace calls to copy_decl_for_inlining with copy_decl_for_dup. (copy_body_r, copy_bb, copy_cfg_body, copy_tree_r, inlining_p): Add versioning support. (copy_decl_for_dup): Rename from copy_decl_for_inlining. Add argument VERSIONING. (copy_arguments_for_versioning, copy_static_chain, function_versionable_p, tree_versionable_function_p, tree_function_versioning, replace_ref_tree): New functions. * tree-inline.h: Include varray.h. (tree_versionable_function_p, tree_function_versioning, tree copy_decl_for_dup): New declarations. From-SVN: r102625
2005-07-31re PR target/23095 (ICE in regstack compensate_edge)Steven Bosscher1-2/+2
PR target/23095 * common.opt (flag_gcse_after_reload): Don't initialize to 2. (flag_rerun_cse_after_loop): Initialize this to 2 instead. * postreload-gcse.c (hash_scan_set): Do not consider stack regs. testsuite/ PR target/23095 * gfortran.dg/pr23095.f: New test. PR c++/22003 * g++.dg/other/pr22003.C: New test. From-SVN: r102610
2005-07-28Makefile.in (rtl-profile.o): Kill all traces of it.Jan Hubicka1-8/+0
* Makefile.in (rtl-profile.o): Kill all traces of it. * common.opt (fspeculative-prefetching, ftree-based-profiling): Kill. * coverage.h (rtl_coverage_counter_ref): Kill. * opts.c (flag_speculative_prefetching_set): Kill. (flag_loop_optimize_set): New. (common_handle_option): Disable loop optimizer when profiling; do not handle speculative prefetching. * passes.c (init_optimization_passes): Replace pass_profiling combo by branch_prob pass. * profile.c (compute_value_histograms): Update for simplified value profiles. (rtl_register_profile_hooks): Kill. (pass_profiling): Kill. (rest_of_handle_branch_prob): Do not profile. * toplev.c (process_options): Remove speculative prefetching. * toplev.h (flag_tree_based_profiling): Kill. * tree-profile.c (prepare_instrumented_value, tree_gen_interval_profiler, tree_gen_pow2_profiler, tree_gen_one_value_profiler, do_tree_profiling): Update for simplified datastructures. * value-prof.c: Add comment that speculative prefetching was dropped; update rest of file for simplified datastructures. (NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX, rtl_divmod_values_to_profile, insn_prefetch_values_to_profile, find_mem_reference_1, find_mem_reference_2, find_mem_reference, rtl_values_to_profile, rtl_divmod_fixed_value, rtl_mod_pow2, rtl_mod_subtract, gen_speculative_prefetch, rtl_divmod_fixed_value_transform, rtl_mod_pow2_value_transform, rtl_mod_subtract_transform, speculative_prefetching_transform): Kill. (gate_handle_value_profile_transformations, rest_of_handle_value_profile_transformations, pass_value_profile_transformations): Kill. * value-prof.h (histogram_value_t): Remove IL based unions. (rtl_register_value_prof_hooks, rtl_register_profile_hooks, rtl_profile_hooks): Remove hooks. * invoke.texi (-ftree-based-profiling, -fspeculative-prefetching): Kill. * inliner-1.c: Do not dump everything. * tree-prof.exp: Do not pass -ftree-based-profiling. * bprob.exp: Likewise. From-SVN: r102522
2005-07-21common.opt (-fforward-propagate): Committed by mistake, removed.Paolo Bonzini1-4/+0
2005-07-21 Paolo Bonzini <bonzini@gnu.org> * common.opt (-fforward-propagate): Committed by mistake, removed. From-SVN: r102239
2005-07-21re PR rtl-optimization/19210 (not using do-loop for some loops)Paolo Bonzini1-0/+15
gcc: 2005-07-21 Paolo Bonzini <bonzini@gnu.org> Zdenek Dvorak <dvorakz@suse.cz> PR tree-optimization/19210 * common.opt (Wunsafe-loop-optimizations, funsafe-loop-optimizations): New. * Makefile.in (tree-ssa-loop-niter.o): Depend intl.o. * loop-iv.c (get_simple_loop_desc): If -funsafe-loop-optimizations, rely on unproven assumptions. * predict.c (predict_loops): Adjust call to number_of_iterations_exit. * tree-flow.h (number_of_iterations_exit): Add final parameter. * tree-scalar-evolution.c (number_of_iterations_in_loop): Adjust call to number_of_iterations_exit. * tree-ssa-loop-ivcanon.c (empty_loop_p): Likewise. * tree-ssa-loop-ivopts.c (niter_for_exit): Likewise. * tree-ssa-loop-niter.c (find_loop_niter, estimate_numbers_of_iterations_loop): Likewise. (number_of_iterations_exit): Honor the new options. * doc/invoke.texi (Wunsafe-loop-optimizations, funsafe-loop-optimizations): Document them. gcc/testsuite: 2005-07-21 Paolo Bonzini <bonzini@gnu.org> * gcc.dg/tree-ssa/pr19210-1.c: New. * gcc.dg/tree-ssa/pr19210-2.c: New. Co-Authored-By: Zdenek Dvorak <dvorakz@suse.cz> From-SVN: r102225
2005-07-19Makefile.in: Removed tree-promote-statics.cDaniel Berlin1-4/+0
2005-07-19 Danny Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> * Makefile.in: Removed tree-promote-statics.c * tree-promote-statics.c: Removed. * common.opt: Removed flag-promote-statics. * opts.c: Ditto. * passes.c: Removed tree-promote-statics pass. * tree-pass.h: Ditto. * timevar.def: Removed TV_PROMOTE_STATICS. 2005-07-19 Danny Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> * gcc.dg/tree-ssa/sra-2.c: Changed back to -O1 and added xfail. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r102165
2005-07-18common.opt (frename-registers): Initialize to 2.Steve Ellcey1-3/+3
* common.opt (frename-registers): Initialize to 2. (fweb): Ditto. (fgcse-after-reload): Ditto. * toplev.c (AUTODETECT_FLAG_VAR_TRACKING): Rename to AUTODETECT_VALUE. (process_options): Only change flag_web, flag_rename_registers, and flag_rerun_cse_after_loop if not explicitly set by user. From-SVN: r102141
2005-07-16Makefile.in: Added rules for ipa-pure-const.c...Daniel Berlin1-0/+16
2005-07-16 Danny Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> * Makefile.in: Added rules for ipa-pure-const.c, ipa-reference.c, ipa-reference.h, ipa-utils.c, ipa-utils.h, ipa-type-escape.c, ipa-type-escape.h, tree-promote-statics.c * ipa-pure-const.c, ipa-reference.c, ipa-reference.h, ipa-utils.c, ipa-utils.h, ipa-type-escape.c, ipa-type-escape.h, tree-promote-statics.c: new files. * alias.c: (nonlocal_mentioned_p_1, nonlocal_mentioned_p, nonlocal_referenced_p_1, nonlocal_referenced_p, nonlocal_set_p_1, int nonlocal_set_p, mark_constant_function): Deleted. (rest_of_handle_cfg): Removed call to mark_constant_function. (nonoverlapping_component_refs_p): Added calls to support type based aliasing. * tree-ssa-alias.c (may_alias_p, compute_flow_insensitive_aliasing): Ditto. * calls.c (flags_from_decl_or_type): Removed reference to cgraph_rtl_info. (flags_from_decl_or_type): Support ECF_POINTER_NO_CAPTURE attribute. * c-common.c (handle_pointer_no_capture_attribute): New function and added pointer_no_capture attribute. * c-typeck.c (convert_arguments): Make builtins tolerant of having too many arguments. This is necessary for Spec 2000. * cgraph.h (const_function, pure_function): Removed. * common.opt: Added "fipa-pure-const", "fipa-reference", "fipa-type-escape", and "ftree-promote-static". * opts.c: Ditto. * passes.c: Added ipa and tree-promote-statics passes. * timevar.def: Added TV_IPA_PURE_CONST, TV_IPA_REFERENCE, TV_IPA_TYPE_ESCAPE, and TV_PROMOTE_STATICS. * tree.h: Support ECF_POINTER_NO_CAPTURE attribute. * tree-dfa.c (referenced_var_lookup_if_exists): New function. * tree-flow.h: Added exposed sra calls and addition of reference_vars_info field for FUNCTION_DECLS. * tree-pass.h: Added passes. * tree-sra.c: (sra_init_cache): New function. (sra_insert_before, sra_insert_after) Made public. (type_can_be_decomposed_p): Renamed from type_can_be_decomposed_p and made public. * tree-ssa-alias.c (dump_alias_stats): Added stats for type based aliasing. (may_alias_p): Added code to use type escape analysis to improve alias sets. * tree-ssa-operands.c (add_call_clobber_ops): Added parameter and code to prune clobbers of static variables based on information produced in ipa-reference pass. Changed call clobbering so that statics are not marked as clobbered if the call does not clobber them. 2005-07-16 Danny Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> * gcc.dg/tree-ssa/ssa-dce-2.c: Changed dg-options to run at -O2 since pure const detection cannot run at -O1 in c compiler. * gcc.dg/tree-ssa/20030714-1.c Changed scanning patterns because we can now optimize this case properly. * gcc.dg/tree-ssa/sra-2.c: Changed to -O3 and removed xfail because we now pass. * gcc.dg/vect/vect-92.c: Removed out of bounds array access. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r102098
2005-07-02c.opt, [...]: Remove "." from end of help texts.Joseph Myers1-10/+10
* c.opt, common.opt, config/bfin/bfin.opt, config/pa/pa.opt, config/rs6000/rs6000.opt, params.def: Remove "." from end of help texts. * config/avr/avr.c: Do not use '`' as left quote. * config/rs6000/rs6000.c, config/s390/s390.c, opts.c, tree.c: Remove "." from end of diagnostics. Make diagnostics start with lowercase letter. cp: * name-lookup.c, parser.c: Use %q, %< and %> to quote in diagnostics. fortran: * lang.opt: Remove "." from end of help texts. objc: * objc-act.c: Use %q to quote in diagnostics. From-SVN: r101533
2005-06-28cgraph.c (cgraph_remove_node): Do not release function bodies until full ↵Jan Hubicka1-0/+4
cgraph is built. * cgraph.c (cgraph_remove_node): Do not release function bodies until full cgraph is built. * cgraph.h (cgraph_decide_inlining_incrementally): Add early argument. * cgraphunit.c (cgraph_finalize_function): Update call of cgraph_decide_inlining_incrementally. (initialize_inline_failed): Break out of ... (cgraph_analyze_function): ... here. (rebuild_cgraph_edges): New function. (pass_rebuild_cgraph_edges): New pass. * common.opt (fearly-inlining): New flag. * ipa-inline.c: Include ggc.h (cgraph_clone_inlined_nodes): Avoid re-using of original copy when cgraph is not fully built. (cgraph_decide_inlining_incrementally): Add early mode. (cgraph_early_inlining): New function. (cgraph_gate_early_inlining): Likewise. (pass_early_ipa_inline): New pass. * ipa.c (cgraph_postorder): NULLify aux pointer. * tree-inline.c (expand_call_inline): Avoid warning early. * tree-optimize.c (pass_early_local_passes): New. (execute_cleanup_cfg_pre_ipa): New. (pass_cleanup_cfg): New. (register_dump_files): Fix handling subpasses of IPA pass. (init_tree_optimization_passes): Add early passes. (execute_ipa_pass_list): Fix handling of subpasses of IPA pass. * passes.h (pass_early_tree_profile, pass_rebuild_cgraph_edges, pass_early_ipa_inline): New passes. * tree-profile.c (do_early_tree_profiling, pass_early_tree_profile): New. * invoke.texi: Document early-inlining. From-SVN: r101369
2005-06-27c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__.Richard Henderson1-0/+12
* c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__. * cfgexpand.c: Include params.h. (has_protected_decls, has_short_buffer): New. (expand_stack_vars): Take a predicate to determine what to expand. (defer_stack_allocation): True when flag_stack_protect on. (SPCT_HAS_LARGE_CHAR_ARRAY, SPCT_HAS_SMALL_CHAR_ARRAY): New. (SPCT_HAS_ARRAY, SPCT_HAS_AGGREGATE): New. (stack_protect_classify_type, stack_protect_decl_phase): New. (stack_protect_decl_phase_1, stack_protect_decl_phase_2): New. (add_stack_protection_conflicts, create_stack_guard): New. (expand_used_vars): Add stack protection logic. (tree_expand_cfg): Likewise. * common.opt (Wstack-protector): New. (fstack-protector, fstack-protector-all): New. * function.c: Include predict.h. (assign_parm_adjust_stack_rtl): Zap stack_parm when stack protect wants to copy the parameter into the stack frame. (stack_protect_prologue, stack_protect_epilogue): New. (expand_function_end): Call stack_protect_epilogue. Do sjlj_emit_function_exit_after after naked_return_label. * function.h (struct function): Add stack_protect_guard. * params.def (PARAM_SSP_BUFFER_SIZE): New. * toplev.c (process_options): Disable flag_stack_protect and/or warn_stack_protect based on FRAME_GROWS_DOWNWARD. * tree.h (stack_protect_prologue): Declare. * target-def.h (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. (TARGET_INITIALIZER): Add them. * target.h (struct gcc_target): Add stack_protect_guard and stack_protect_fail. * targhooks.c: Include ggc.h, gty header. (stack_chk_guard_decl, default_stack_protect_guard): New. (stack_chk_fail_decl, default_external_stack_protect_fail): New. (default_hidden_stack_protect_fail): New. * targhooks.h (default_stack_protect_guard): Declare. (default_external_stack_protect_fail): Declare. (default_hidden_stack_protect_fail): Declare. * config/i386/i386.c (TARGET_STACK_PROTECT_FAIL): New. * config/i386/i386.md (UNSPEC_SP_SET, UNSPEC_SP_TEST): New. (trap): Use ud2. (conditional_trap, conditional_trap_1): Remove. (stack_protect_set, stack_protect_set_si, stack_protect_set_di): New. (stack_protect_test, stack_protect_test_si, stack_protect_test_di): New. * doc/md.texi (stack_protect_set, stack_protect_test): New. * doc/tm.texi (TARGET_STACK_PROTECT_GUARD): New. (TARGET_STACK_PROTECT_FAIL): New. * libgcc-std.ver (GCC_4.1.0): New. * libgcc.h (__stack_chk_guard): Declare. (__stack_chk_fail, __stack_chk_fail_local): Declare. * libgcc2.c (L_stack_chk, L_stack_chk_local): New. * mklibgcc.in (lib2funcs): Add them. From-SVN: r101348
2005-06-25Update FSF address.Kelley Cook1-2/+2
From-SVN: r101317
2005-06-24tree-optimize.c (init_tree_optimization_passes): Fix flags of all_passes and ↵Jan Hubicka1-0/+4
all_ipa_passes. * tree-optimize.c (init_tree_optimization_passes): Fix flags of all_passes and all_ipa_passes. * c-common.c: Include cgraph.h (handle_externally_visible_attribute): New function. (c_common_att): Add "externally_visible" attribute. * cgraph.c (decide_is_variable_needed): Obey externally visible flag. (cgraph_varpool_finalize_decl): Avoid redundant checking. * cgraph.h (struct cgraph_node): New flag externally_visible. (decide_is_function_needed): Obey externally visible flag. (cgraph_finalize_function): Avoid redundant checks. (cgraph_function_and_variable_visibility): Bring symbols local when asked for. * common.opt (fwhole-program): New flag. * doc/invoke.texi (-fwhole-program): Document. From-SVN: r101295
2005-06-04lcm.c: Move all mode-switching related functions from here...Steven Bosscher1-1/+0
* lcm.c: Move all mode-switching related functions from here... * mode-switching.c: ...to this new file. * doc/passes.texi: Update accordingly. * basic-block.h (label_value_list): Remove extern decl. * cfgrtl.c (label_value_list): Remove. (can_delete_label_p): Don't look at it. * cfgcleanup.c (cleanup_cfg): Don't free it. * common.opt: Don't refer to non-existing flag_alias_check. From-SVN: r100591
2005-06-01common.opt (fjump-tables): New.Joseph Myers1-0/+4
* common.opt (fjump-tables): New. * doc/invoke.texi (-fno-jump-tables): Document. * stmt.c (expand_end_case_type): Do not emit jump tables unless flag_jump_tables. From-SVN: r100457
2005-05-25common.opt (-Wattributes): New.DJ Delorie1-0/+4
* common.opt (-Wattributes): New. Default true. * doc/invoke.texi (-Wno-attributes): Document. * attribs.c (decl_attributes): Move warning control from if() to warning(OPT_*). * c-common.c (handle_packed_attribute): Likewise. (handle_nocommon_attribute): Likewise. (handle_common_attribute): Likewise. (handle_noreturn_attribute): Likewise. (handle_noinline_attribute): Likewise. (handle_always_inline_attribute): Likewise. (handle_used_attribute): Likewise. (handle_unused_attribute): Likewise. (handle_const_attribute): Likewise. (handle_transparent_union_attribute): Likewise. (handle_constructor_attribute): Likewise. (handle_destructor_attribute): Likewise. (handle_mode_attribute): Likewise. (handle_alias_attribute): Likewise. (handle_visibility_attribute): Likewise. (handle_tls_model_attribute): Likewise. (handle_malloc_attribute): Likewise. (handle_returns_twice_attribute): Likewise. (handle_pure_attribute): Likewise. (handle_deprecated_attribute): Likewise. (handle_vector_size_attribute): Likewise. (handle_nothrow_attribute): Likewise. (handle_cleanup_attribute): Likewise. (handle_warn_unused_result_attribute): Likewise. (handle_sentinel_attribute): Likewise. * c-decl.c (diagnose_mismatched_decls): Likewise. (start_decl): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. * c-format.c (check_function_format): Likewise. * stor-layout.c (place_field): Likewise. (finalize_record_size): Likewise. * tree.c (handle_dll_attribute)): Likewise. * varasm.c (default_assemble_visibility): Likewise. * config/darwin.c (darwin_handle_weak_import_attribute): Likewise. (darwin_assemble_visibility): Likewise. * config/arc/arc.c (arc_handle_interrupt_attribute): Likewise. * config/arm/arm.c (arm_handle_fndecl_attribute): Likewise. (arm_handle_isr_attribute): Likewise. * config/avr/avr.c (avr_handle_progmem_attribute): Likewise. (avr_handle_fndecl_attribute): Likewise. * config/bfin/bfin.c (handle_int_attribute): Likewise. * config/c4x/c4x.c (c4x_handle_fntype_attribute): Likewise. * config/h8300/h8300.c (h8300_handle_fndecl_attribute): Likewise. (h8300_handle_eightbit_data_attribute): Likewise. (h8300_handle_tiny_data_attribute): Likewise. * config/i386/i386.c (ix86_handle_cdecl_attribute): Likewise. (ix86_handle_regparm_attribute): Likewise. (ix86_handle_struct_attribute): Likewise. * config/i386/winnt.c (ix86_handle_shared_attribute): Likewise. (i386_pe_encode_section_info): Likewise. * config/ia64/ia64.c (ia64_handle_model_attribute): Likewise. * config/ip2k/ip2k.c (ip2k_handle_progmem_attribute): Likewise. (ip2k_handle_fndecl_attribute): Likewise. * config/m32r/m32r.c (m32r_handle_model_attribute): Likewise. * config/m68hc11/m68hc11 (m68hc11_handle_page0_attribute): Likewise. (m68hc11_handle_fntype_attribute): Likewise. (m68hc11_encode_section_info): Likewise. * config/m68k/m68k.c (m68k_handle_fndecl_attribute): Likewise. * config/mcore/mcore.c (mcore_handle_naked_attribute): Likewise. * config/ns32k/ns32k.c (ns32k_handle_fntype_attribute): Likewise. * config/rs6000/rs6000.c (rs6000_handle_longcall_attribute): Likewise. * config/sh/sh.c (sh_handle_interrupt_handler_attribute): Likewise. (sh_handle_sp_switch_attribute): Likewise. (sh_handle_trap_exit_attribute): Likewise. * config/sh/symbian.c (sh_symbian_dllimport_p): Likewise. (sh_symbian_handle_dll_attribute): Likewise. * config/stormy16/stormy16.c (xstormy16_handle_interrupt_attribute): Likewise. (xstormy16_handle_below100_attribute): Likewise. * config/v850/v850.c (v850_handle_interrupt_attribute): Likewise. [testsuite] * gcc.dg/Wattributes-1.c: New. * gcc.dg/Wattributes-2.c: New. * gcc.dg/Wattributes-3.c: New. [cp] * decl.c (duplicate_decls): Move warning control from if() to warning(OPT_*). * name-lookup.c (parse_using_directive): Likewise. * parser.c (cp_parser_elaborated_type_specifier): Likewise. (cp_parser_init_declarator): Likewise. * tree.c (handle_com_interface_attribute): Likewise. [java] * class.c (set_constant_value): Move warning control from if() to warning(OPT_*). From-SVN: r100136
2005-05-03common.opt (fdiagnostics-show-option): No variable is needed.DJ Delorie1-1/+1
* common.opt (fdiagnostics-show-option): No variable is needed. * diagnostic.h (diagnostic_context): Add show_option_requested flag. * diagnostic.c (diagnostic_initialize): Initialize show_option_requested. (diagnostic_report_diagnostic): Test for enabled diagnostics here. Save and restore original message format. Use flag in context instead of global. (warning): Don't test for enabled warnings here. * opts.c (common_handle_option): Handle -fdiagnostics-show-option here. From-SVN: r99204
2005-05-03c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery decide if the ↵DJ Delorie1-0/+4
warning will be printed. * c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery decide if the warning will be printed. * calls.c (expand_call): Likewise. * function.c (init-function_start): Likewise. * common.opt (-fdiagnostics-show-option): New. * opts.c (option_enabled): Accept the option index instead of a pointer to the option descriptor. * opts.h (option_enabled): Likewise. * toplev.c (print_switch_values): Pass option index, not option descriptor. * diagnostic.h (diagnostic_info): Add option_index. * diagnostic.c: Include opts.h. (diagnostic_set_info): Initialize option_index. (diagnostic_report_diagnostic): Amend option name if appropriate. (warning): Check to see if the specified warning is enabled. Store option index. * doc/invoke.texi (-fdiagnostics-show-options): Document. From-SVN: r99169
2005-04-08backport: copy-prop, incremental SSA updating of FUD chains and newly ↵Diego Novillo1-0/+16
exposed symbols. Merge from tree-cleanup-branch: VRP, store CCP, store copy-prop, incremental SSA updating of FUD chains and newly exposed symbols. * Makefile.in (tree-ssa-copy.o): Depend on tree-ssa-propagate.h. (OBJS-common): Add tree-vrp.o. (tree-vrp.o): New rule. * basic-block.h (nearest_common_dominator_for_set): Declare. * common.opt (ftree-store-ccp): New flag. (ftree-copy-prop): New flag. (ftree-vrp): New flag. (ftree-store-copy-prop): New flag. * dominance.c (nearest_common_dominator_for_set): New. * domwalk.c (walk_dominator_tree): Only traverse statements in blocks marked in walk_data->interesting_blocks. * domwalk.h (struct dom_walk_data): Add field interesting_blocks. * fold-const.c (fold): Handle ASSERT_EXPR. * opts.c (decode_options): Set flag_tree_copy_prop at -O1. Set flag_tree_store_ccp, flag_tree_store_copy_prop and flag_tree_vrp at -O2. * timevar.def (TV_TREE_VRP): Define. (TV_TREE_COPY_PROP): Define. (TV_TREE_STORE_COPY_PROP): Define. (TV_TREE_SSA_INCREMENTAL): Define. (TV_TREE_STORE_CCP): Define. * tree-cfg.c (tree_can_merge_blocks_p): Remove reference to kill_redundant_phi_nodes from comment. (verify_expr): Handle ASSERT_EXPR. * tree-dfa.c (mark_new_vars_to_rename): Remove second argument. Update all users. (mark_call_clobbered_vars_to_rename): Remove. Update all users. * tree-flow-inline.h (unmodifiable_var_p): New. * tree-flow.h (enum value_range_type): Declare. (struct value_range_def): Declare. (value_range): Declare. (remove_all_phi_nodes_for): Remove. Update all users. (find_phi_node_for): Declare. (add_type_alias): Declare. (count_uses_and_derefs): Declare. (kill_redundant_phi_nodes): Remove. (rewrite_into_ssa): Remove. (rewrite_def_def_chains): Remove. (update_ssa, register_new_name_mapping, create_new_def_for, need_ssa_update_p, name_registered_for_update_p, release_ssa_name_after_update_ssa, dump_repl_tbl, debug_repl_tbl, dump_names_replaced_by, debug_names_replaced_by, mark_sym_for_renaming, mark_set_for_renaming, get_current_def, set_current_def, get_value_range, dump_value_range, debug_value_range, dump_all_value_ranges, debug_all_value_ranges, expr_computes_nonzero, loop_depth_of_name, unmodifiable_var_p): Declare. * tree-gimple.c (is_gimple_formal_tmp_rhs): Handle ASSERT_EXPR. * tree-into-ssa.c (block_defs_stack): Update comment. (old_ssa_names, new_ssa_names, old_virtual_ssa_names, syms_to_rename, names_to_release, repl_tbl, need_to_initialize_update_ssa_p, need_to_update_vops_p, need_to_replace_names_p): New locals. (NAME_SETS_GROWTH_FACTOR): Define. (struct repl_map_d): Declare. (struct mark_def_sites_global_data): Add field interesting_blocks. (enum rewrite_mode): Declare. (REGISTER_DEFS_IN_THIS_STMT): Define. (compute_global_livein): Use last_basic_block instead of n_basic_blocks. (set_def_block): Remove last argument. Update all callers. (prepare_use_operand_for_rename): Remove. Update all callers. (prepare_def_operand_for_rename): Remove. Update all callers. (symbol_marked_for_renaming): New. (is_old_name): New. (is_new_name): New. (repl_map_hash): New. (repl_map_eq): New. (repl_map_free): New. (names_replaced_by): New. (add_to_repl_tbl): New. (add_new_name_mapping): New. (mark_def_sites): Assume that all the operands in the statement are in normal form. (find_idf): Assert that the block in the stack is valid. (get_default_def_for): New. (insert_phi_nodes_for): Add new argument 'update_p'. Add documentation. If update_p is true, add a new mapping between the LHS of each new PHI and the name that it replaces. (insert_phi_nodes_1): Only call find_idf if needed. (get_reaching_def): Call get_default_def_for. (rewrite_operand): Remove. (rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT and REWRITE_THIS_STMT are false. Assume that all the operands in the statement are in normal form. (rewrite_add_phi_arguments): Don't use PHI_REWRITTEN. (rewrite_virtual_phi_arguments): Remove. (invalidate_name_tags): Remove. (register_new_update_single, register_new_update_set, rewrite_update_init_block, replace_use, rewrite_update_fini_block, rewrite_update_stmt, rewrite_update_phi_arguments): New. rewrite_blocks): Remove argument 'fix_virtual_phis'. Add arguments 'entry', 'what' and 'blocks'. Initialize the dominator walker according to 'what' and 'blocks'. Start the dominator walk at 'entry'. (mark_def_site_blocks): Add argument 'interesting_blocks'. Use it to configure the dominator walker. (rewrite_into_ssa): Remove argument 'all'. Make internal. (rewrite_all_into_ssa): Remove. (rewrite_def_def_chains): Remove. (mark_def_interesting, mark_use_interesting, prepare_phi_args_for_update, prepare_block_for_update, prepare_def_site_for, prepare_def_sites, dump_names_replaced_by, debug_names_replaced_by, dump_repl_tbl, debug_repl_tbl, init_update_ssa, delete_update_ssa, create_new_def_for, register_new_name_mapping, mark_sym_for_renaming, mark_set_for_renaming, need_ssa_update_p, name_registered_for_update_p, ssa_names_to_replace, release_ssa_name_after_update_ssa, insert_updated_phi_nodes_for, update_ssa): New. * tree-loop-linear.c (linear_transform_loops): Call update_ssa instead of rewrite_into_ssa. * tree-optimize.c (vars_to_rename): Remove. Update all users. (init_tree_optimization_passes): Replace pass_redundant_phi with pass_copy_prop. Add pass_vrp. Replace pass_ccp with pass_store_ccp. Add pass_store_copy_prop after pass_store_ccp. (execute_todo): If the TODO_ flags don't include updating the SSA form, assert that it does not need to be updated. Call update_ssa instead of rewrite_into_ssa and rewrite_def_def_chains. If TODO_verify_loops is set, call verify_loop_closed_ssa. (tree_rest_of_compilation): * tree-pass.h (TODO_dump_func, TODO_ggc_collect, TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts, TODO_cleanup_cfg): Renumber. (TODO_verify_loops, TODO_update_ssa, TODO_update_ssa_no_phi, TODO_update_ssa_full_phi, TODO_update_ssa_only_virtuals): Define. (pass_copy_prop, pass_store_ccp, pass_store_copy_prop, pass_vrp): Declare. * tree-phinodes.c (make_phi_node): Update documentation. (remove_all_phi_nodes_for): Remove. (find_phi_node_for): New. * tree-pretty-print.c (dump_generic_node): Handle ASSERT_EXPR. * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise. (interpret_rhs_modify_expr): Likewise. * tree-sra.c (decide_instantiations): Mark all symbols in SRA_CANDIDATES for renaming. (mark_all_v_defs_1): Rename from mark_all_v_defs. (mark_all_v_defs): New function. Update all users to call it with the whole list of scalarized statements, not just the first one. * tree-ssa-alias.c (count_ptr_derefs): Make extern. (compute_flow_insensitive_aliasing): If the tag is unmodifiable and the variable isn't or vice-versa, don't make them alias of each other. (setup_pointers_and_addressables): If the type tag for VAR is about to change, mark the old one for renaming. (add_type_alias): New. * tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP. (ccp_lattice_t): Rename from latticevalue. (value): Remove. Update all users. (const_val): New local variable. (do_store_ccp): New local variable. (dump_lattice_value): Handle UNINITIALIZED. (debug_lattice_value): New. (get_default_value): Re-write. (set_lattice_value): Re-write. (def_to_varying): Remove. Update all users. (likely_value): Return VARYING for statements that make stores when STORE_CCP is false. Return VARYING for any statement other than MODIFY_EXPR, COND_EXPR and SWITCH_EXPR. (ccp_initialize): Re-write. (replace_uses_in, replace_vuse_in, substitute_and_fold): Move to tree-ssa-propagate.c. (ccp_lattice_meet): Handle memory stores when DO_STORE_CCP is true. (ccp_visit_phi_node): Likewise. (ccp_fold): Likewise. (evaluate_stmt): Likewise. (visit_assignment): Likewise. (ccp_visit_stmt): Likewise. (execute_ssa_ccp): Add argument 'store_ccp'. Copy it into DO_STORE_CCP. (do_ssa_ccp): New. (pass_ccp): Use it. (do_ssa_store_ccp): New. (gate_store_ccp): New. (pass_store_ccp): Declare. * tree-ssa-copy.c: Include tree-ssa-propagate.h. (may_propagate_copy): Reformat. Don't abort if ORIG is a virtual and DEST isn't. If NEW does not have alias information but DEST does, copy it. (copy_of, cached_last_copy_of, do_store_copy_prop, enum copy_prop_kind, which_copy_prop): Declare. (stmt_may_generate_copy, get_copy_of_val, get_last_copy_of, set_copy_of_val, dump_copy_of, copy_prop_visit_assignment, copy_prop_visit_cond_stmt, copy_prop_visit_stmt, copy_prop_visit_phi_node, init_copy_prop, fini_copy_prop, execute_copy_prop, gate_copy_prop, do_copy_prop, gate_store_copy_prop, store_copy_prop): New. (pass_copy_prop, pass_store_copy_prop): Declare. * tree-ssa-dom.c (struct opt_stats_d): Add fields 'num_const_prop' and 'num_copy_prop'. (cprop_operand): Update them. (dump_dominator_optimization_stats): Dump them. (tree_ssa_dominator_optimize): Call update_ssa instead of rewrite_into_ssa. (loop_depth_of_name): Declare extern. (simplify_cond_and_lookup_avail_expr): Guard against NULL values for LOW or HIGH. (cprop_into_successor_phis): Only propagate if NEW != ORIG. (record_equivalences_from_stmt): Call expr_computes_nonzero. (cprop_operand): Only propagate if VAL != OP. * tree-ssa-dse.c (dse_optimize_stmt): Mark symbols in removed statement for renaming. * tree-ssa-loop-im.c (move_computations): Call update_ssa. * tree-ssa-loop-ivopts.c (rewrite_address_base): Call add_type_alias if necessary. Call mark_new_vars_to_rename. (tree_ssa_iv_optimize): If new symbols need to be renamed, mark every statement updated, call update_ssa and rewrite_into_loop_closed_ssa. * tree-ssa-loop-manip.c (add_exit_phis): Do not remove DEF_BB from LIVEIN if VAR is a virtual. * tree-ssa-loop.c (tree_loop_optimizer_init): Call update_ssa. * tree-ssa-operands.c (get_expr_operands): Handle ASSERT_EXPR. (get_call_expr_operands): Reformat statement. (add_stmt_operand): Don't create V_MAY_DEFs for read-only symbols. * tree-ssa-propagate.c (ssa_prop_init): Initialize SSA_NAME_VALUE for every name. (first_vdef, stmt_makes_single_load, stmt_makes_single_store, get_value_loaded_by): New. (replace_uses_in, replace_vuses_in, replace_phi_args_in, substitute_and_fold): Move from tree-ssa-ccp.c. * tree-ssa-propagate.h (struct prop_value_d, prop_value_t, first_vdef, stmt_makes_single_load, stmt_makes_single_store, get_value_loaded_by, replace_uses_in, substitute_and_fold): Declare. * tree-ssa.c (verify_use): Fix error message. (propagate_into_addr, replace_immediate_uses, get_eq_name, check_phi_redundancy, kill_redundant_phi_nodes, pass_redundant_phi): Remove. Update all users. * tree-vect-transform.c (vect_create_data_ref_ptr): Call add_type_alias, if necessary. * tree-vectorizer.h (struct _stmt_vect_info): Update documentation for field 'memtag'. * tree-vrp.c: New file. * tree.def (ASSERT_EXPR): Define. * tree.h (ASSERT_EXPR_VAR): Define. (ASSERT_EXPR_COND): Define. (SSA_NAME_VALUE_RANGE): Define. (struct tree_ssa_name): Add field 'value_range'. (PHI_REWRITTEN): Remove. (struct tree_phi_node): Remove field 'rewritten'. * doc/invoke.texi (-fdump-tree-storeccp, -ftree-copy-prop, -ftree-store-copy-prop): Document. * doc/tree-ssa.texi: Remove broken link to McCAT's compiler. Document usage of update_ssa. testsuite/ChangeLog * g++.dg/tree-ssa/pr18178.C: New test. * gcc.c-torture/execute/20030216-1.x: Ignore at -O1. * gcc.c-torture/execute/20041019-1.c: New test. * gcc.dg/tree-ssa/20041008-1.c: New test. * gcc.dg/tree-ssa/ssa-ccp-12.c: New test. * gcc.dg/tree-ssa/20030731-2.c: Update to use -fdump-tree-store_ccp. * gcc.dg/tree-ssa/20030917-1.c: Likewise. * gcc.dg/tree-ssa/20030917-3.c: Likewise. * gcc.dg/tree-ssa/20040721-1.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-1.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-3.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-7.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-9.c: Likewise. From-SVN: r97884
2005-04-06c.opt (-F): Remove trailing whitespace from help string.Richard Sandiford1-3/+3
* c.opt (-F): Remove trailing whitespace from help string. (-finput-charset): Use a tab to separate the switch name and help string. * common.opt (-fsched-stalled-insns, -fsched-stalled-insns-dep) (-ftree-vectorizer-verbose): Likewise. From-SVN: r97742
2005-03-28Make -f[no-]show-column also control non-cpp diagnostics.Per Bothner1-1/+5
* c.opt (fshow-column): Move option from here ... * common.opt (fshow-column): ... to here. * diagnostic.c (diagnostic_build_prefix): Only print column number if flag_show_column. From-SVN: r97127
2005-03-18common.opt (m): Remove.Richard Sandiford1-3/+0
* common.opt (m): Remove. * opts.c (handle_option): Pass 'm' options to set_target_switch if table lookup fails. (common_handle_option): Remove OPT_m case. From-SVN: r96650