aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
AgeCommit message (Collapse)AuthorFilesLines
2011-04-18re PR c/48650 (valgrind: Invalid write of size 8 in build_string (tree.c:1524))Richard Guenther1-1/+1
2011-04-18 Richard Guenther <rguenther@suse.de> PR middle-end/48650 * tree.c (build_string): STRING_CST is now derived from tree_typed. From-SVN: r172642
2011-04-14tree.h (struct tree_constructor): Include tree_typed instead of tree_common.Nathan Froyd1-1/+1
* tree.h (struct tree_constructor): Include tree_typed instead of tree_common. * tree.c (initialize_tree_contains_struct): Mark TS_CONSTRUCTOR as TS_TYPED instead of TS_COMMON. From-SVN: r172409
2011-04-13tree-flow.h (struct gimple_df): Make free_ssanames a VEC.Nathan Froyd1-1/+1
* tree-flow.h (struct gimple_df): Make free_ssanames a VEC. * tree-ssanames.c (fini_ssanames): VEC_free it. (make_ssa_name_fn): Update for VECness of free_ssanames. (release_ssa_name, release_dead_ssa_names): Likewise. * tree.h (struct tree_ssa_name): Include tree_typed instead of tree_common. * tree.c (initialize_tree_contains_struct): Mark TS_SSA_NAME as TS_TYPED instead of TS_COMMON. From-SVN: r172393
2011-04-13tree.h (struct tree_int_cst, [...]): Include tree_typed instead of tree_common.Nathan Froyd1-3/+3
* tree.h (struct tree_int_cst, struct real_value): Include tree_typed instead of tree_common. (struct tree_fixed_cst, struct tree_string, struct tree_complex): Likewise. * tree.c (initialize_tree_contains_struct): Mark such nodes as being TS_TYPED rather than TS_COMMON. * print-tree.c (print_node) [STRING_CST]: Don't print TREE_CHAIN. From-SVN: r172386
2011-04-13ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling ↵Nathan Froyd1-58/+8
TREE_CHAIN. gcc/ada/ * gcc-interface/ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * gcc-interface/misc.c (gnat_init_ts): New function. (LANG_HOOKS_INIT_TS): Define. gcc/ * c-decl.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * print-tree.c (print_node): Likewise. * tree-inline.c (copy_tree_r): Likewise. * c-lang.c (LANG_HOOKS_INIT_TS): Define. * lto-streamer-in.c (lto_input_tree_pointers): Check for TS_TYPED instead of TS_COMMON. * lto-streamer-out.c (lto_output_tree_pointers): Likewise. * tree.c (initialize_tree_contains_struct): Handle TS_TYPED. (copy_node_stat): Zero TREE_CHAIN only if necessary. (MARK_TS_BASE, MARK_TS_TYPED, MARK_TS_COMMON): Move these... (MARK_TS_DECL_COMMON, MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL): ...and these... (MARK_TS_DECL_WITH_VIS, MARK_TS_DECL_NON_COMMON): ...and these... * tree.h: ...here. (TREE_CHAIN): Check for a TS_COMMON structure. (TREE_TYPE): Check for a TS_TYPED structure. gcc/c-family/ * c-common.h (c_common_init_ts): Declare. * c-common.c (c_common_init_ts): Define. gcc/cp/ * cp-lang.c (cp_init_ts): Call cp_common_init_ts. Move tree_contains_struct initialization to... * cp-objcp-common.c (cp_common_init_ts): ...here. Use MARK_* macros. * cp-objcp-common.h (cp_common_init_ts): Declare. * cp-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/fortran/ * f95-lang.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/go/ * go-lang.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/java/ * java-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/lto/ * lto-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * lto.c (lto_fixup_common): Likewise. gcc/objc/ * objc-lang.c (objc_init_ts): Move code for this function... * objc-act.c (objc_common_init_ts): ...here. Define. * objc-act.h (objc_common_init_ts): Declare. gcc/objcp/ * objcp-lang.c (objcxx_init_ts): Call objc_common_init_ts and cp_common_init_ts. From-SVN: r172359
2011-04-12tree.h (struct typed_tree): New.Nathan Froyd1-1/+7
* tree.h (struct typed_tree): New. (struct tree_common): Include it instead of tree_base. (TREE_TYPE): Update for new location of type field. (TYPE_USER_ALIGN, TYPE_PACKED): Refer to base field directly. (DECL_USER_ALIGN, DECL_PACKED): Likewise. (union tree_node): Add typed field. * treestruct.def (TS_TYPED): New. * lto-streamer.c (check_handled_ts_structures): Handle it. * tree.c (MARK_TS_TYPED): New macro. (MARK_TS_COMMON): Call it instead of MARK_TS_BASE. From-SVN: r172295
2011-04-09Bail out rather than crashing in array_type_nelts if TYPE_MAX_VALUE is null.Duncan Sands1-0/+4
From-SVN: r172227
2011-04-04tree.h (struct tree_const_decl): Inherit from tree_decl_common.Nathan Froyd1-2/+1
* tree.h (struct tree_const_decl): Inherit from tree_decl_common. * tree.c (initialize_tree_contains_struct): Adjust accordingly. From-SVN: r171923
2011-04-03tree.c (free_lang_data_in_decl): Zero DECL_VINDEX if it's not an integer.Michael Matz1-0/+7
* tree.c (free_lang_data_in_decl): Zero DECL_VINDEX if it's not an integer. * tree.h (tree_decl_non_common.vindex): Adjust comment. From-SVN: r171904
2011-04-03tree.c (decl_init_priority_insert): Don't create entry for default priority.Michael Matz1-44/+4
* tree.c (decl_init_priority_insert): Don't create entry for default priority. (decl_fini_priority_insert): Ditto. (fields_compatible_p, find_compatible_field): Remove. * tree.h (fields_compatible_p, find_compatible_field): Remove. * gimple.c (gimple_compare_field_offset): Adjust block comment. From-SVN: r171902
2011-03-25Changelog c-family/Kai Tietz1-6/+2
2011-03-25 Kai Tietz <ktietz@redhat.com> * c-ada-spec.c (compare_comment): Use filename_cmp instead of strcmp for filename. Changelog fortran/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * scanner.c (preprocessor_line): Use filename_cmp instead of strcmp. Changelog gcc/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * collect2.c (write_c_file_stat): Handle backslash as right-hand directory separator. (resolve_lib_name): Use IS_DIR_SEPARATOR instead of checking just for slash. * coverage.c (coverage_init): Use IS_ABSOLUTE_PATH instead of checking for trailing slash. * gcc.c (record_temp_file): Use filename_cmp instead of strcmp. (do_spec_1): Likewise. (replace_outfile_spec_function): Likewise. (is_directory): Use filename_ncmp instead of strncmp. (print_multilib_info): Likewise. * gcov.c (find_source): Use filename_cmp instead instead of strcmp. (make_gcov_file_name): Fix order of slash/backslash checks. * incpath.c (DIRS_EQ): Use filename_cmp instead of strcmp. (add_standard_paths): Likewise. * mips-tfile.c (saber_stop): Handle backslash. * prefix.c (update_path): Use filename_ncmp instead of strncmp. * profile.c (output_location): Use filename_cmp instead of strcmp. * read-md.c (handle_toplevel_file): Handle backslash. * tlink.c (frob_extension): Likewise. * tree-cfg.c (same_line_p): Use filename_cmp instead of strcmp. * tree-dump.c (dequeue_and_dump): Handle backslash. * tree.c (get_file_function_name): Likewise. * gengtype.c (read_input_list): Likewise. (get_file_realbasename): Likewise. (get_output_file_with_visibility): Use filename_cmp instead of strcmp. ChangeLog java/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * jcf-parse.c (java_read_sourcefilenames): Use filename_cmp instead of strcmp. (set_source_filename): Likewise. * win32-host.c (jcf_open_exact_case): Likewise. ChangeLog lto/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * lto.c (lto_resolution_read): Use filename_cmp instead of strcmp. (lto_read_section_data): Likewise. ChangeLog cp/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * lex.c (interface_strcmp): Handle dos-paths. (handle_pragma_implementation): Use filename_cmp instead of strcmp. (in_main_input_context): Likewise. From-SVN: r171522
2011-03-25ChangeLog gcc/Kai Tietz1-31/+75
2011-03-25 Kai Tietz <ktietz@redhat.com> * c-typeck.c (comptypes_internal): Replace target hook call of comp_type_attributes by version in tree.c file. * gimple.c (gimple_types_compatible_p_1): Likewise. * tree-ssa.c (useless_type_conversion_p): Likewise. * tree.c (build_type_attribute_qual_variant): Likewise. (attribute_value_equal): New static helper function. (comp_type_attributes): New function. (merge_attributes): Use attribute_value_equal for comparison. (attribute_list_contained): Likewise. * tree.h (comp_type_attributes): New prototype. ChangeLog cp/ 2011-03-25 Kai Tietz <ktietz@redhat.com> * decl.c (decls_match): Replace target hook call of comp_type_attributes by version in tree.c file. * search.c (check_final_overrider): Likewise. * typeck.c (structural_comptypes): Likewise. From-SVN: r171445
2011-03-24tree.c (record_node_allocation_statistics): New function.Nathan Froyd1-56/+40
* tree.c (record_node_allocation_statistics): New function. (make_node_stat, copy_node_stat, build_string): Call it. (make_tree_binfo_stat, make_tree_vec_stat, tree_cons_stat): Likewise. (build1_stat, build_omp_clause): Likewise. From-SVN: r171399
2011-03-24re PR tree-optimization/46562 (CCP currently needs iteration for &a[i])Richard Guenther1-0/+14
2011-03-24 Richard Guenther <rguenther@suse.de> PR tree-optimization/46562 * tree.c (build_invariant_address): New function. * tree.h (build_invariant_address): Declare. * tree-dfa.c (get_addr_base_and_unit_offset): Wrap around a renamed function moved ... * tree-flow-inline.h (get_addr_base_and_unit_offset_1): ... here. Take valueization callback parameter. * tree-flow.h (gimple_fold_stmt_to_constant): Declare. * gimple-fold.h: New file. * tree-ssa-ccp.c (ccp_fold): Use gimple_fold_stmt_to_constant_1. (ccp_fold, fold_const_aggregate_ref, fold_ctor_reference, fold_nonarray_ctor_reference, fold_array_ctor_reference, fold_string_cst_ctor_reference, get_base_constructor): Move ... * gimple-fold.c: ... here. (gimple_fold_stmt_to_constant_1): New function split out from ccp_fold. Take a valueization callback parameter. Valueize all operands. (gimple_fold_stmt_to_constant): New wrapper function. (fold_const_aggregate_ref_1): New function split out from fold_const_aggregate_ref. Take a valueization callback parameter. (fold_const_aggregate_ref): Wrap fold_const_aggregate_ref_1. * tree-ssa-sccvn.c (simplify_binary_expression): Simplify invariant POINTER_PLUS_EXPRs to invariant form. (vn_valueize): New function. (try_to_simplify): Simplify by using gimple_fold_stmt_to_constant. * tree-vrp.c (vrp_valueize): New function. (vrp_visit_assignment_or_call): Use gimple_fold_stmt_to_constant to fold statements to constants. * tree-ssa-pre.c (eliminate): Properly guard propagation of function declarations. * Makefile.in (tree-ssa-sccvn.o, tree-vrp.o, gimple-fold.o, tree-ssa-ccp.o): Add gimple-fold.h dependencies. * c-c++-common/pr46562-2.c: New testcase. * c-c++-common/pr46562.c: Likewise. From-SVN: r171386
2011-03-22tree.c (build_call_1): New function.Nathan Froyd1-12/+20
* tree.c (build_call_1): New function. (build_call_valist, build_call_array_loc, build_call_vec): Call it. From-SVN: r171288
2011-03-14re PR tree-optimization/48098 (internal compiler error: in ↵Richard Guenther1-2/+8
build_vector_from_val, at tree.c:1380) 2011-03-14 Richard Guenther <rguenther@suse.de> PR middle-end/48098 * tree.c (build_vector_from_val): Adjust assert to requirements and reality. * gcc.dg/torture/pr48098.c: New testcase. From-SVN: r170934
2011-03-11re PR c++/48073 (ICE with -flto in templated C++ code)Richard Guenther1-1/+2
2011-03-11 Richard Guenther <rguenther@suse.de> PR lto/48073 * tree.c (find_decls_types_r): Do not walk types only reachable from IDENTIFIER_NODEs. * g++.dg/lto/20110311-1_0.C: New testcase. From-SVN: r170875
2011-03-11re PR c++/48069 (FAIL: g++.old-deja/g++.pt/spec26.C)Jason Merrill1-2/+1
PR c++/48069 * tree.c (type_hash_eq): Use COMPLETE_TYPE_P, not COMPLETE_OR_UNBOUND_ARRAY_TYPE_P. From-SVN: r170872
2011-03-10re PR c++/48029 (ICE in finish_member_declaration() with --param ↵Jason Merrill1-2/+9
ggc-min-expand=0 --param ggc-min-heapsize=0) PR c++/48029 * stor-layout.c (layout_type): Don't set structural equality on arrays of incomplete type. * tree.c (type_hash_eq): Handle comparing them properly. * cp/pt.c (iterative_hash_template_arg): Remove special case for ARRAY_TYPE. From-SVN: r170853
2011-02-20re PR target/47822 (Multiple test suite failures due to revision 170321)Richard Guenther1-0/+19
2011-02-20 Richard Guenther <rguenther@suse.de> PR lto/47822 * tree.c (free_lang_data_in_decl): Clean builtins from the TU decl BLOCK_VARS. From-SVN: r170339
2011-01-26c.opt (-fkeep-inline-dllexport): New switch.Dave Korn1-3/+4
gcc/c-family/ChangeLog: * c.opt (-fkeep-inline-dllexport): New switch. gcc/ChangeLog: * tree.c (handle_dll_attribute): Handle it. * doc/extend.texi (@item dllexport): Mention it. * doc/invoke.texi (@item -fno-keep-inline-dllexport): Document it. gcc/cp/ChangeLog: * semantics.c (expand_or_defer_fn_1): Handle it. * decl2.c (decl_needed_p): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/dll-9a.c: New test file. * gcc.dg/dll-11.c: Likewise. * gcc.dg/dll-12.c: Likewise. * gcc.dg/dll-12a.c: Likewise. * gcc.dg/dll-11a.c: Likewise. * gcc.dg/dll-9.c: Likewise. * gcc.dg/dll-10.c: Likewise. * gcc.dg/dll-10a.c: Likewise. * g++.dg/ext/dllexport4a.cc: Likewise. * g++.dg/ext/dllexport4.C: Likewise. * g++.dg/ext/dllexport5.C: Likewise. * g++.dg/ext/dllexport5a.cc: Likewise. From-SVN: r169268
2011-01-01ChangeLog gcc/Kai Tietz1-9/+10
2011-01-01 Kai Tietz <kai.tietz@onevision.com> PR target/38662 * tree.c (type_hash_eq): Call language hook for METHOD_TYPEs, too. ChangeLog gcc/cp 2011-01-01 Kai Tietz <kai.tietz@onevision.com> PR target/38662 * tree.c (cxx_type_hash_eq): Allow METHOD_TYPE, too. ChangeLog gcc/testsuite 2011-01-01 Kai Tietz <kai.tietz@onevision.com> PR target/38662 * g++.dg/eh/pr38662.C: New testcase. From-SVN: r168389
2010-12-26tree.c (get_binfo_at_offset): Use BINFO_TYPE instead of TREE_TYPE, compare ↵Martin Jambor1-2/+2
TYPE_MAIN_VARIANTs of types. 2010-12-26 Martin Jambor <mjambor@suse.cz> * tree.c (get_binfo_at_offset): Use BINFO_TYPE instead of TREE_TYPE, compare TYPE_MAIN_VARIANTs of types. From-SVN: r168255
2010-12-22re PR tree-optimization/45934 (g++.old-deja/g++.other/dtor5.C FAILs with ↵Martin Jambor1-4/+9
-finline-small-functions) 2010-12-22 Martin Jambor <mjambor@suse.cz> PR tree-optimization/45934 PR tree-optimization/46302 PR tree-optimization/46987 * gimple-fold.c (get_base_binfo_for_type): Removed. (gimple_get_relevant_ref_binfo): Likewise. (gimple_fold_obj_type_ref_call): Dumb down to 4.5 functionality, removed parameter inplace, updated the caller. * gimple.h (gimple_get_relevant_ref_binfo): Remove declaration. * ipa-cp.c (ipcp_propagate_types): Do not derive types from constants. (ipcp_discover_new_direct_edges): Do not do devirtualization based on constants. * ipa-prop.c (compute_known_type_jump_func): Use get_ref_base_and_extent and get_binfo_at_offset instead of gimple_get_relevant_ref_binfo. (compute_known_type_jump_func): Likewise. (update_jump_functions_after_inlining): Do not derive types from constants. (try_make_edge_direct_virtual_call): Likewise. * tree.c (get_binfo_at_offset): Get type from non-artificial fields. * testsuite/g++.dg/ipa/ipcp-ivi-1.C: Removed. * testsuite/g++.dg/ipa/ivinline-6.C: Likewise. * testsuite/g++.dg/otr-fold-1.C: Likewise. * testsuite/g++.dg/otr-fold-2.C: Likewise. * testsuite/g++.dg/tree-ssa/pr43411.C: Xfail dump scan. * testsuite/g++.dg/tree-ssa/pr45605.C: Likewise. * testsuite/g++.dg/tree-ssa/pr46987.C: New test. From-SVN: r168168
2010-12-15tree.c (get_file_function_name): Avoid using random seed on GLOBAL_sub_I and ↵Jan Hubicka1-2/+6
GLOBAL_sub_D. * tree.c (get_file_function_name): Avoid using random seed on GLOBAL_sub_I and GLOBAL_sub_D. From-SVN: r167858
2010-12-02tree.c (build_range_type_1): Do not SET_TYPE_STRUCTURAL_EQUALITY for a ↵Eric Botcazou1-7/+8
non-shared type. * tree.c (build_range_type_1): Do not SET_TYPE_STRUCTURAL_EQUALITY for a non-shared type. From-SVN: r167393
2010-12-01tree.c (build_common_builtin_nodes): Do not initialize ↵Jan Hubicka1-6/+0
BUILT_IN_PROFILE_FUNC_ENTER and BUILT_IN_PROFILE_FUNC_EXIT. * tree.c (build_common_builtin_nodes): Do not initialize BUILT_IN_PROFILE_FUNC_ENTER and BUILT_IN_PROFILE_FUNC_EXIT. * builtins.c (expand_builtin_profile_func): Remove. (expand_builtin): Do not handle BUILT_IN_PROFILE_FUNC_ENTER and BUILT_IN_PROFILE_FUNC_EXIT. * builtins.def (profile_func_enter, profile_func_exit): Remove stubs. (__cyg_profile_func_enter, __cyg_profile_func_exit): New. * gimplify.c (gimplify_function_tree): Reorganize code calling profiling functions. From-SVN: r167342
2010-12-01common.opt (main_input_filename, [...]): New Variable entries.Joseph Myers1-0/+105
* common.opt (main_input_filename, main_input_basename, main_input_baselength): New Variable entries. From toplev.c. * final.c (output_quoted_string): Move from toplev.c. * output.h (output_quoted_string): Move from toplev.h. * opts-global.c (read_cmdline_options): Use gcc_options pointer to access main_input_filename, main_input_baselength and main_input_basename. * targhooks.c: Include intl.h and opts.h. (option_affects_pch_p, default_get_pch_validity): Move from toplev.c. * targhooks.h (option_affects_pch_p, default_get_pch_validity): Move from toplev.h. * toplev.c (main_input_filename, main_input_basename, main_input_baselength): Move to common.opt. (output_quoted_string): Move to final.c. (warn_deprecated_use): Move to tree.c. (option_affects_pch_p, default_get_pch_validity, pch_option_mismatch, default_pch_valid_p): Move to targhooks.c. * toplev.h (skip_leading_substring): Move to tree-dump.c. (warn_deprecated_use): Move to tree.h. (output_quoted_string): Move to output.h. (main_input_filename, main_input_basename, main_input_baselength): Move to common.opt. (default_get_pch_validity, default_pch_valid_p): Move to targhooks.c. * tree-dump.c (skip_leading_substring): Move from toplev.h. * tree.c (warn_deprecated_use): Move from toplev.c. * tree.h (warn_deprecated_use): Move from toplev.h. * c-typeck.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/cris/cris.c, config/crx/crx.c, config/fr30/fr30.c, config/frv/frv.c, config/h8300/h8300.c, config/ia64/ia64.c, config/iq2000/iq2000.c, config/lm32/lm32.c, config/m32c/m32c.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mep/mep.c, config/microblaze/microblaze.c, config/mips/mips.c, config/mmix/mmix.c, config/mn10300/mn10300.c, config/moxie/moxie.c, config/pa/pa.c, config/pdp11/pdp11.c, config/picochip/picochip.c, config/s390/s390.c, config/score/score.c, config/sh/sh.c, config/sparc/sparc.c, config/spu/spu.c, config/stormy16/stormy16.c, config/v850/v850.c, config/vax/vax.c, config/xtensa/xtensa.c, gimple-low.c, graphite-sese-to-poly.c, plugin.c, tree-cfg.c, tree-inline.c, varasm.c, xcoffout.c: Don't include toplev.h. * Makefile.in (c-typeck.o, tree-inline.o, tree-cfg.o, gimple-low.o, graphite-sese-to-poly.o, targhooks.o, plugin.o, varasm.o, xcoffout.o): Update dependencies. * config/arm/t-arm (arm.o): Update dependencies. * config/spu/t-spu-elf (spu.o): Update dependencies. cp: * cp-objcp-common.c, lex.c, typeck.c: Don't include toplev.h. * Make-lang.in (cp/lex.o, cp/cp-objcp-common.o, cp/typeck2.o): Update dependencies. java: * jcf-parse.c: Don't include toplev.h. * Make-lang.in (java/jcf-parse.o): Don't depend on toplev.h. From-SVN: r167329
2010-11-30re PR middle-end/46725 (ICE when compiling ↵Eric Botcazou1-4/+2
libstdc++-v3/include/precompiled/stdc++.h) PR middle-end/46725 Revert 2010-11-30 Eric Botcazou <ebotcazou@adacore.com> * tree.c (build_range_type_1): Do not set TYPE_STRUCTURAL_EQUALITY_P because of self-referential bounds. From-SVN: r167300
2010-11-30tree.c (build_range_type_1): Do not set TYPE_STRUCTURAL_EQUALITY_P because ↵Eric Botcazou1-2/+4
of self-referential bounds. * tree.c (build_range_type_1): Do not set TYPE_STRUCTURAL_EQUALITY_P because of self-referential bounds. From-SVN: r167297
2010-11-25target.def (supports_split_stack, [...]): Take gcc_options parameters.Joseph Myers1-1/+2
* target.def (supports_split_stack, except_unwind_info): Take gcc_options parameters. * targhooks.c (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Take gcc_options parameters. * targhooks.h (default_except_unwind_info, dwarf2_except_unwind_info, sjlj_except_unwind_info): Update prototypes. * doc/tm.texi.in (TARGET_IRA_COVER_CLASSES, TARGET_HAVE_NAMED_SECTIONS, TARGET_UNWIND_TABLES_DEFAULT): Document that hooks must not be modified. (TARGET_EXCEPT_UNWIND_INFO): Refer to opts argument. * doc/tm.texi: Regenerate. * defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Pass &global_options to targetm.except_unwind_info. * dwarf2out.c (dwarf2out_do_frame, dwarf2out_do_cfi_asm, dwarf2out_begin_prologue, dwarf2out_frame_init, dwarf2out_frame_finish, dwarf2out_assembly_start): Pass &global_options to targetm.except_unwind_info. * except.c (init_eh, finish_eh_generation, gate_convert_to_eh_region_ranges, output_one_function_exception_table): Pass &global_options to targetm.except_unwind_info. * expr.c (build_personality_function): Pass &global_options to targetm.except_unwind_info. * function.c (expand_function_end): Pass &global_options to targetm.except_unwind_info. * hooks.c (hook_bool_bool_gcc_optionsp_false): New. * hooks.h (hook_bool_bool_gcc_optionsp_false): Declare. * opts.c (finish_options): Pass opts to targetm.except_unwind_info and targetm.supports_split_stack. Remove assertions about opts and opts_set. (common_handle_option): Remove assertions about opts, opts_set and dc. * tree-tailcall.c (suitable_for_tail_call_opt_p): Pass &global_options to targetm.except_unwind_info. * tree.c (build_common_builtin_nodes: Pass &global_options to targetm.except_unwind_info. * config/arm/arm.c (arm_except_unwind_info): Add gcc_options parameter. (arm_compute_func_type, arm_expand_prologue, thumb_pushpop, thumb1_expand_prologue, thumb1_output_function_prologue, arm_unwind_emit, arm_output_fn_unwind): Update calls to arm_except_unwind_info. * config/i386/i386.c (ix86_supports_split_stack): Add gcc_options parameter. * config/ia64/ia64.c (ia64_except_unwind_info): Add gcc_options parameter. (ia64_output_function_prologue, ia64_add_bundle_selector_before, ia64_reorg, ia64_asm_unwind_emit): Update calls to ia64_except_unwind_info. * config/pa/pa.c (pa_option_override): Pass &global_options to targetm.except_unwind_info. * config/picochip/picochip-protos.h (picochip_except_unwind_info): Remove prototype. c-family: * c-cppbuiltin.c (c_cpp_builtins): Pass &global_options to targetm.except_unwind_info. From-SVN: r167145
2010-11-11re PR tree-optimization/46383 (ICE: in get_binfo_at_offset, at tree.c:10947)Martin Jambor1-2/+2
2010-11-11 Martin Jambor <mjambor@suse.cz> PR tree-optimization/46383 * ipa-prop.c (compute_complex_assign_jump_func): Ignore negative offsets. (compute_complex_ancestor_jump_func): Likewise. * tree.c (get_binfo_at_offset): Return NULL_TREE if offset is negative. * testsuite/g++.dg/torture/pr46383.C: New test. From-SVN: r166598
2010-11-09tree.h (contains_placeholder_p): Fix comment.Eric Botcazou1-8/+11
* tree.h (contains_placeholder_p): Fix comment. (type_contains_placeholder_p): Adjust comment. * tree.c (contains_placeholder_p): Fix comment. (type_contains_placeholder_1): Do not recurse on pointed-to types and adjust comment. (type_contains_placeholder_p): Add comment. ada/ * gcc-interface/decl.c (finish_fat_pointer_type): New function. (gnat_to_gnu_entity) <E_Array_Type>: Use it to build the fat pointer type. <E_Access_Type>: Likewise. From-SVN: r166484
2010-11-03builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert.Nathan Froyd1-7/+37
gcc/ * builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert. * c-typeck.c (build_function_call_vec): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * cgraphunit.c (assemble_thunk): Likewise. * config/sparc/sparc.c (sparc_fold_builtin): Likewise. * fold-const.c (fold_unary_loc, fold_mult_zconjz): Likewise. (fold_binary_loc, fold_ternary_loc): Likewise. * gimple-fold.c (get_symbol_constant_value): Likewise. * gimple-low.c (lower_builtin_setjmp): Likewise. * gimple.c (gimple_cond_get_ops_from_tree): Likewise. * gimplify.c (gimplify_init_constructor): Likewise. * lambda.h (build_linear_expr): Likewise. * omp-low.c (omp_reduction_init): Likewise. * tree-inline.c (remap_ssa_name): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-sra.c (init_subtree_with_zero): Likewise. (sra_ipa_modify_assign): Likewise. * tree-ssa-copy.c (propagate_tree_value_into_stmt): Likewise. * tree-ssa-reassoc.c (eliminate_duplicate_pair): Likewise. (eliminate_plus_minus_pair, eliminate_not_pairs): Likewise. (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise. * tree-vect-stmts.c (vectorizable_call): Likewise. * tree.c (build_vector_from_ctor, build_one_cst): Likewise. (build_zero_cst): Handle more cases directly. Update comment. gcc/cp/ * class.c (build_base_path, add_vcall_offset): Use build_zero_cst instead of fold_convert. * init.c (build_zero_init): Likewise. * typeck.c (cp_build_binary_op): Likewise. gcc/fortran/ * trans-decl.c (add_argument_checking): Use build_zero_cst instead of fold_convert. * trans-expr.c (gfc_conv_missing_dummy, fill_with_spaces): Likewise. * trans-stmt.c (gfc_trans_do): Likewise. From-SVN: r166227
2010-11-02re PR middle-end/46120 (g++.dg/ipa/ivinline-?.C)Martin Jambor1-19/+21
2010-11-02 Martin Jambor <mjambor@suse.cz> PR middle-end/46120 * tree.c (get_binfo_at_offset): Bail out on artificial fields. Identify primary bases according to their offsets. * testsuite/g++.dg/ipa/ivinline-9.C: New test. From-SVN: r166192
2010-11-01* tree.c (build_vector_from_val): Use useless_type_conversion_p.Nathan Froyd1-2/+2
From-SVN: r166136
2010-10-31fold-const.c (build_zero_vector): Use build_vector_from_val.Nathan Froyd1-11/+4
* fold-const.c (build_zero_vector): Use build_vector_from_val. * tree-vect-loop.c (get_initial_def_for_induction): Likewise. (get_initial_def_for_reduction): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * tree-vect-stmts.c (vect_get_vec_def_for_operand): Likewise. * tree.c (build_one_cst): Likewise. (build_vector_from_val): Use types_compatible_p for assert. From-SVN: r166102
2010-10-29tree.h (build_vector_from_val): Declare.Artjoms Sinkarovs1-0/+22
2010-10-29 Artjoms Sinkarovs <artyom.shinakroff@gmail.com> Andrew Pinski <pinskia@gmail.com> * tree.h (build_vector_from_val): Declare. * tree.c (build_vector_from_val): New function. * c-typeck.c (build_binary_op): Handle vector shifting. * doc/extend.texi: Description of the vector shifting operation. testsuite/ * gcc.c-torture/execute/vector-shift.c: New testcase. * gcc.c-torture/execute/vector-shift1.c: Likewise. * gcc.c-torture/execute/vector-shift2.c: Likewise. * gcc.dg/vector-shift.c: Likewise. * gcc.dg/vector-shift1.c: Likewise. * gcc.dg/torture/vector-shift2.c: Likewise. * gcc.dg/vector-shift3.c: Likewise. * gcc.dg/simd-1b.c: Adjust. Co-Authored-By: Andrew Pinski <pinskia@gmail.com> From-SVN: r166061
2010-10-21re PR tree-optimization/45875 (ice in gimple_fold_obj_type_ref_known_binfo ↵Martin Jambor1-3/+0
with -O2) 2010-10-21 Martin Jambor <mjambor@suse.cz> PR tree-optimization/45875 * tree.c (get_binfo_at_offset): Remove initial zero offset test. * testsuite/g++.dg/ipa/pr45875.C: New test. From-SVN: r165780
2010-10-18re PR lto/44950 (ICE in dwarf2out_finish, at dwarf2out.c:22271)Richard Guenther1-0/+9
2010-10-18 Richard Guenther <rguenther@suse.de> PR lto/44950 * tree.c (free_lang_data_in_decl): As we clear TYPE_METHODS also clear references to entries of it. * g++.dg/lto/20101015-2_0.C: New testcase. From-SVN: r165629
2010-10-15tree.c (free_lang_data_in_decl): Clear DECL_INITIAL for automatic variables ↵Richard Guenther1-2/+3
again. 2010-10-15 Richard Guenther <rguenther@suse.de> * tree.c (free_lang_data_in_decl): Clear DECL_INITIAL for automatic variables again. * g++.dg/lto/20101015-1_0.C: New testcase. From-SVN: r165511
2010-10-15re PR tree-optimization/45957 (g++.dg/ext/fnname3.C FAILs with -flto/-fwhopr)Richard Guenther1-16/+0
2010-10-15 Richard Guenther <rguenther@suse.de> PR lto/45957 * tree.c (free_lang_data_in_decl): Do not clear DECL_INITIAL of vars. * g++.dg/lto/20101014-1_0.C: New testcase. From-SVN: r165502
2010-10-14sched-deps.c (sched_insn_is_legitimate_for_speculation): Invoke ↵Eric Botcazou1-0/+8
may_trap_or_fault_p instead of may_trap_p predicate. * sched-deps.c (sched_insn_is_legitimate_for_speculation): Invoke may_trap_or_fault_p instead of may_trap_p predicate. * tree.c (substitute_in_expr): Propagate the TREE_THIS_NOTRAP flag. (substitute_placeholder_in_expr): Likewise. * tree-inline.c (remap_gimple_op_r): Propagate the TREE_THIS_NOTRAP flag on MEM_REF nodes. (copy_tree_body_r): Propagate the TREE_READONLY and TREE_THIS_NOTRAP flags on INDIRECT_REF nodes. ada/ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Set TREE_THIS_NOTRAP on the INDIRECT_REF node built for the template. * gcc-interface/trans.c (Identifier_to_gnu): Set TREE_THIS_NOTRAP on the INDIRECT_REF node built for objects used by reference. * gcc-interface/utils2.c (build_binary_op): Add short-circuit for constant result. Set TREE_THIS_NOTRAP on ARRAY_REF and ARRAY_RANGE_REF. (gnat_stabilize_reference_1): Propagate the TREE_THIS_NOTRAP flag. From-SVN: r165468
2010-10-14re PR c++/44561 (using nullptr_t with -flto/-fwhopr causes ICE: tree code ↵Richard Guenther1-0/+4
'lang_type' is not supported in gimple streams) 2010-10-14 Richard Guenther <rguenther@suse.de> PR lto/44561 * tree.def (NULLPTR_TYPE): New tree code. * dbxout.c (dbxout_type): Handle NULLPTR_TYPE. * dwarf2out.c (is_base_type): Likewise. (gen_type_die_with_usage): Likewise. * sdbout.c (plain_type_1): Likewise. * tree.c (build_int_cst_wide): Likewise. * gimple.c (gimple_types_compatible_p_1): NULLPTR_TYPE types are equal. cp/ * cp-tree.h (NULLPTR_TYPE_P): Adjust. * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node, use build_int_cst. * error.c (dump_type): Handle NULLPTR_TYPE. (dump_type_prefix): Likewise. (dump_type_suffix): Likewise. * mangle.c (write_type): Likewise. * name-lookup.c (arg_assoc_type): Likewise. * rtti.c (typeinfo_in_lib_p): Likewise. * pt.c (tsubst): Likewise. * g++.dg/lto/20101010-3_0.C: New testcase. * g++.dg/lto/20101010-4_0.C: Likewise. From-SVN: r165462
2010-10-13Centralize knowledge of eh personality routines.Richard Henderson1-5/+1
From-SVN: r165433
2010-10-09re PR lto/45947 (ICE: tree code 'template_decl' is not supported in gimple ↵Richard Guenther1-1/+1
streams with -flto/-fwhopr) 2010-10-09 Richard Guenther <rguenther@suse.de> PR lto/45947 * tree.c (free_lang_data_in_cgraph): Properly walk the varpool. * g++.dg/lto/20101009-1_0.C: New testcase. From-SVN: r165234
2010-10-08lto-streamer-in.c (lto_input_ts_decl_minimal_tree_pointers): Re-construct ↵Richard Guenther1-63/+1
BLOCK_VARS. 2010-10-08 Richard Guenther <rguenther@suse.de> * lto-streamer-in.c (lto_input_ts_decl_minimal_tree_pointers): Re-construct BLOCK_VARS. (lto_input_ts_block_tree_pointers): Do not stream BLOCK_VARS. * lto-streamer-out.c (lto_output_ts_block_tree_pointers): Likewise. * tree.c (free_lang_data_in_block): Remove. (free_lang_data_in_decl): Do not touch DECL_CONTEXT of non-PARM_DECLs. Do not touch the BLOCK tree. * expr.c (expand_expr_real_1): Allow externals. From-SVN: r165191
2010-09-30opt-functions.awk (static_var): Update comment.Joseph Myers1-2/+4
* opt-functions.awk (static_var): Update comment. (var_ref): Return offsetof expression or -1, not variable address. * optc-gen.awk: Generate structure field initializers instead of static variables. Expect -1 for missing variables instead of null pointer. Add gcc_options parameters to generated functions. * opth-gen.awk: Generate structure fields for static variables. Add gcc_options parameters to generated functions. * common.opt (optimize, optimize_size): Add variables. * config/i386/i386-c.c (ix86_pragma_target_parse): Pass &global_options to cl_target_option_restore. * config/i386/i386.c (ix86_valid_target_attribute_p): Pass &global_options to cl_optimization_restore, cl_target_option_save and cl_target_option_restore. (ix86_set_current_function): Pass &global_options to cl_target_option_restore. * config/pdp11/pdp11.h (optimize): Remove. * config/rs6000/rs6000.h (optimize): Remove. * config/sh/sh.h (optimize): Remove. * config/xtensa/xtensa.h (optimize): Remove. * coretypes.h (struct gcc_options): Declare. * diagnostic.c (diagnostic_initialize): Initialize context->option_state. (diagnostic_report_diagnostic): Pass option_state to option_enabled hook. * diagnostic.h (diagnostic_context.option_enabled): Add void * parameter. (diagnostic_context.option_state): New field. * final.c (final_start_function, final, final_scan_insn): Rename optimize parameter to optimize_p. * flags.h (optimize, optimize_size): Remove. * function.c (invoke_set_current_function_hook): Pass &global_options to cl_optimization_restore. * gcc.c (driver_handle_option): Take gcc_options parameter. Assert that it is &global_options. (process_command): Pass &global_options to read_cmdline_option. * ipa-pure-const.c (suggest_attribute): Pass &global_options to option_enabled. * lto-opts.c (lto_reissue_options): Use option_flag_var. Pass &global_options to set_option. * opts-common.c (handle_option, handle_generated_option, read_cmdline_option, set_option): Take explicit gcc_options parameters. Use option_flag_var. (option_flag_var): New. * opts.c (common_handle_option, lang_handle_option, target_handle_option): Take gcc_options parameter. Assert that it is &global_options. (read_cmdline_options): Pass &global_options to read_cmdline_option. (print_filtered_help): Use option_flag_var. Pass &global_options to option_enabled. (common_handle_option): Use option_flag_var. (option_enabled): Take opts parameter. Use option_flag_var. (get_option_state): Take gcc_options parameter. Use option_flag_var. Pass gcc_options parameter to option_enabled. (enable_warning_as_error): Pass &global_options to handle_generated_option. * opts.h (struct cl_option): Change flag_var to flag_var_offset. (cl_option_handler_func.handler): Take gcc_options parameter. (option_enabled, get_option_state, set_option, handle_option, handle_generated_option, read_cmdline_option): Take gcc_options parameters. * toplev.c (optimize, optimize_size): Remove. (print_switch_values): Pass &global_options to option_enabled. (option_affects_pch_p): Use option_flag_var. Pass &global_options to get_option_state. (general_init): Initialize global_dc->option_state. * tree.c (build_optimization_node): Pass &global_options to cl_optimization_save. (build_target_option_node): Pass &global_options to cl_target_option_save. c-family: * c-common.c (handle_optimize_attribute): Pass &global_options to cl_optimization_save and cl_optimization_restore. * c-opts.c (c_common_handle_option): Pass &global_options to handle_generated_option. * c-pragma.c (handle_pragma_diagnostic): Use option_flag_var. (handle_pragma_pop_options, handle_pragma_reset_options): Pass &global_options to cl_optimization_restore. From-SVN: r164751
2010-09-28Hookize TARGET_UNWIND_INFO et al.Richard Henderson1-2/+2
From-SVN: r164701
2010-09-24extend.texi: (attribute leaf): Document.Jan Hubicka1-13/+16
* doc/extend.texi: (attribute leaf): Document. * tree.c (local_define_builtin): Handle ECF_LEAF. (build_common_builtin_nodes): Set ECF_LEAF where needed. * tree.h (ECF_LEAF): New. * ipa-reference.c (propagate_bits): For leaf calls propagate ever overwrittable and unavailable functions. (ipa_init): Put all_module_statics into optimization_summary_obstack. (copy_global_bitmap): Do not copy all_module_statics. (read_write_all_from_decl): Use cgraph_node argument; handle ECF_LEAF. (propagate): Handle overwritable and unavailable leaf functions; initialize global info for overwritable and unavailable leaf functions; do not free all module statics. (ipa_reference_get_not_read_global, ipa_reference_get_not_written_global): leaf calls don't clobber local statics. * calls.c (flags_from_decl_or_type): Handle leaf. * tree-cfg.c (stmt_can_make_abnormal_goto): Leaf functions can't do abnormal gotos. * c-common.c (handle_leaf_attribute): New function. (struct attribute_spec c_common_att): Add leaf. * gcc.dg/tree-ssa/leaf.c: New testcase. From-SVN: r164606