Commit Graph

128 Commits

Author SHA1 Message Date
Jan Hubicka 1632a68673 gimple-fold.c (can_refer_decl_in_current_unit_p): Do not accept abstract functions; for static functions check the presence of body.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Do not accept
	abstract functions; for static functions check the presence
	of body.

From-SVN: r202626
2013-09-16 11:47:48 +00:00
Andrew MacLeod 7a30045280 tree-ssa.h: New.
* tree-ssa.h: New.  Move content from tree-flow.h and
	tree-flow-inline.h.
	* tree-flow.h (_edge_var_map, edge_var_map_vector): Move to tree-ssa.h.
	Move prototypes belonging to tree-ssa.c.
	* tree-flow-inline.h (redirect_edge_var_map_def, 
	redirect_edge_var_map_result, redirect_edge_var_map_location): Move to
	tree-ssa.h.
	* gimple.h: Adjust prototypes.
	* tree-ssa.c (useless_type_conversion_p, types_compatible_p): Move to...
	* gimple.c (useless_type_conversion_p, types_compatible_p):  Here.
	* tree.h: Move prototype to tree-ssa.h.
	* gengtype.c (open_base_files): Replace tree-flow.h with tree-ssa.h.
	* Makefile.in: (TREE_SSA_H, TREE_FLOW_H): Adjust dependencies.
	* alias.c, asan.c, builtins.c, calls.c, cfgexpand.c, cfghooks.c,
	cfgloop.c, cfgloopmanip.c, cgraph.c, cgraphbuild.c, cgraphclones.c,
	cgraphunit.c, dse.c, except.c, expr.c, final.c, fold-const.c,
	ggc-page.c, gimple-fold.c, gimple-iterator.c, gimple-low.c,
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c,
	gimple-streamer-in.c, gimple-streamer-out.c, gimple.c, gimplify.c,
	graphite-blocking.c, graphite-clast-to-gimple.c, graphite-dependences.c,
	graphite-interchange.c, graphite-optimize-isl.c, graphite-poly.c,
	graphite-scop-detection.c, graphite-sese-to-poly.c, graphite.c,
	ipa-cp.c, ipa-inline-analysis.c, ipa-inline-transform.c, ipa-inline.c,
	ipa-prop.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c,
	loop-init.c, lto-cgraph.c, lto-section-in.c, lto-section-out.c,
	lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, omp-low.c,
	passes.c, predict.c, print-tree.c, profile.c, sese.c, targhooks.c,
	tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c,
	tree-chrec.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-eh.c,
	tree-emutls.c, tree-if-conv.c, tree-inline.c, tree-into-ssa.c,
	tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nrv.c,
	tree-object-size.c, tree-optimize.c, tree-outof-ssa.c, tree-parloops.c,
	tree-phinodes.c, tree-predcom.c, tree-pretty-print.c, tree-profile.c,
	tree-scalar-evolution.c, tree-sra.c, tree-ssa*.c, tree-stdarg.c,
	tree-streamer-in.c, tree-switch-conversion.c, tree-tailcall.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
	tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c,
	tree-vect-stmts.c, tree-vectorizer.c, tree-vrp.c, tsan.c,
	value-prof.c, var-tracking.c,
	varpool.c, vtable-verify.c: Replace tree-flow.h with tree-ssa.h

From-SVN: r202523
2013-09-12 13:03:18 +00:00
Jan Hubicka 668b689457 gimple-fold.c (gimple_get_virt_method_for_binfo): Pass real VAR_DECL of vtable rather than full expression.
* gimple-fold.c (gimple_get_virt_method_for_binfo): Pass real
	VAR_DECL of vtable rather than full expression.

From-SVN: r202446
2013-09-10 13:46:31 +00:00
Jan Hubicka 2aa3da06e0 * gimple-fold.c (gimple_get_virt_method_for_binfo): Use ctor_for_folding.
From-SVN: r202002
2013-08-26 15:40:40 +00:00
Jan Hubicka 1d5755efee cgraph.c (cgraph_create_indirect_edge): Discover polymorphic calls and record basic info into indirect_info.
* cgraph.c (cgraph_create_indirect_edge): Discover
	polymorphic calls and record basic info into indirect_info.
	* gimple-fold.c (gimple_fold_call): When doing BINFO based
	devirtualization, ignore objc function calls.
	* ipa-cp.c (initialize_node_lattices): Be ready for polymorphic
	call with no parm index info.
	* ipa-prop.c (ipa_analyze_call_uses): Likewise.
	* tree.c (virtual_method_call_p): New function.
	* tree.h (virtual_method_call_p): Declare.

From-SVN: r201824
2013-08-18 09:22:42 +00:00
Jan Hubicka c49bdb2ee9 gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Add new arugment expected_type.
* gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Add new
	arugment expected_type.
	(gimple_fold_call): Use it.
	* gimple.h (gimple_extract_devirt_binfo_from_cst): Update prototype.
	* ipa-cp.c (ipa_get_indirect_edge_target_1): Update.
	* ipa-prop.c (ipa_analyze_virtual_call_uses): Use
	obj_type_ref_class.
	(try_make_edge_direct_virtual_call): Likewise.
	* tree.c (obj_type_ref_class): New.
	* tree.h (obj_type_ref_class): Use it.

From-SVN: r201789
2013-08-16 12:38:04 +00:00
Ondřej Bílka 688010bad0 Fix typos.
2013-07-21   Ondřej Bílka  <neleai@seznam.cz>

	* c-common.c: Fix typos.
	* c-common.h: Likewise.

From-SVN: r201110
2013-07-21 18:31:07 +00:00
Jan Hubicka d84db1ed8a gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Use types_same_for_odr.
* gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Use
	types_same_for_odr.
	* tree.c (decls_same_for_odr): New function.
	(same_for_edr): New function.
	(types_same_for_odr): New function.
	(get_binfo_at_offset): Use it.
	* tree.h (types_same_for_odr): Declare.

From-SVN: r200288
2013-06-21 06:43:39 +00:00
Jan Hubicka 6a6dac5293 cgraph.h (const_value_known_p): Replace by ...
* cgraph.h (const_value_known_p): Replace by ...
	(ctor_for_folding): .. this one.
	* cgraphunit.c (process_function_and_variable_attributes): Use it.
	* lto-cgraph.c (compute_ltrans_boundary): Use ctor_for_folding.
	* expr.c (expand_expr_real_1): Likewise.
	(string_constant): Likewise.
	* tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise.
	* ipa.c (process_references): Likewise.
	(symtab_remove_unreachable_nodes): Likewise.
	* ipa-inline-analysis.c (param_change_prob): Likewise.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	(get_base_constructor): Likwise.
	* varpool.c (varpool_remove_node): Likewise.
	(varpool_remove_initializer): LIkewise.
	(dump_varpool_node): LIkwise.
	(const_value_known_p): Rewrite to ...
	(ctor_for_folding): ... this one.

	* lto-partition.c (add_references_to_partition): Use
	ctor_for_folding.

	* gcc.dg/tree-ssa/attr-alias-2.c: New testcase.

From-SVN: r200211
2013-06-19 18:06:12 +00:00
Jan Hubicka 08346abd19 c-common.c (handle_alias_ifunc_attribute): Do not set DECL_EXTERNAL for weakref variables.
* c-family/c-common.c (handle_alias_ifunc_attribute): Do not set
	DECL_EXTERNAL for weakref variables.
	* c-family/c-pragma.c (handle_pragma_weak): Make sure aliases
	are not declared as external.
	* cgraph.c (cgraph_create_function_alias): Set weakref flag.
	* cgraph.h (symtab_node_base): Add weakref flag.
	* cgraphunit.c (cgraph_reset_node): Clear weakref flag.
	(handle_alias_pairs): Set weakref flag, do not set DECL_EXTERNAL.
	(output_weakrefs): Use weakref flag.
	* fold-const.c (simple_operand_p): Handle WEAK.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Drop weakref.
	* ipa.c (varpool_externally_visible_p): Drop weakref.
	(function_and_variable_visibility): Update comment; fix weakref
	sanity checks; do not clear DECL_WEAK on them.
	* lto-cgraph.c (lto_output_node): update.
	(lto_output_varpool_node): Update.
	(input_overwrite_node): Update.
	(input_node): Update.
	(input_varpool_node): Update.
	* lto-symtab.c (lto_symtab_symbol_p): Do not special case weakrefs.
	(lto_symtab_merge_symbols): Add sanity check.
	(lto_symtab_prevailing_decl): Do not special case weakrefs.
	* passes.c (rest_of_decl_compilation): Set static flag, too.
	* symtab.c (dump_symtab_base): Dump weakref.
	(verify_symtab_base): Sanity check weakrefs.
	(symtab_make_decl_local): Remove duplicated code.
	(symtab_alias_ultimate_target): Simplify.
	* varpool.c (varpool_create_variable_alias): Set weakref flag.

	* lto-partition.c (get_symbol_class): Simplify weakref handling.
	(add_symbol_to_partition_1): Likewise.
	(contained_in_symbol): Likewise.
	(lto_balanced_map): Likewise.
	(rename_statics): Drop weakref.

From-SVN: r199971
2013-06-11 22:41:54 +00:00
Jan Hubicka e70670cf4d cgraph.h (symtab_node_base): Add definition, alias and analyzed flags...
* cgraph.h (symtab_node_base): Add definition, alias and analyzed
	flags; reorder rest of fields in more consistent way.
	(varpool_node): Remove analyzed, finalized and alias.
	(cgraph_ndoe): Likewise.
	(symtab_alias_ultimate_target): New function.
	(cgraph_function_node): Move offline.
	(cgraph_reset_node): Declare.
	(cgraph_comdat_can_be_unshared_p): Remove.
	(varpool_remove_initializer): Declare.
	(varpool_first_defined_variable, varpool_next_defined_variable
	cgraph_first_defined_function, cgraph_next_defined_function): Update.
	(cgraph_function_with_gimple_body_p): Update.
	(varpool_all_refs_explicit_p): Update.
	(symtab_alias_target): New function.
	(cgraph_alias_aliased_node, varpool_alias_aliased_node): Rename to ...
	(cgraph_alias_target, varpool_alias_target): .. this one; simplify.
	(cgraph_function_or_thunk_node): Simplify using symtab_alias_ultimate_target.
	(varpool_variable_node): Likewise.
	* cgraph.c (cgraph_create_function_alias): Update.
	(cgraph_add_thunk): Update.
	(cgraph_remove_node): Update.
	(dump_cgraph_node): Do not dump removed flags.
	(cgraph_function_body_availability): Update.
	(cgraph_propagate_frequency): Update.
	(verify_cgraph_node): Check sanity of local flag.
	(cgraph_function_node): Move here from cgraph.h; revamp for
	cgraph_function_or_thunk_node.
	* lto-symtab.c (lto_varpool_replace_node): Update.
	(lto_symtab_resolve_can_prevail_p): Update.
	(lto_symtab_merge_cgraph_nodes): Update.
	* ipa-cp.c (determine_versionability, initialize_node_lattices,
	propagate_constants_accross_call, devirtualization_time_bonus,
	ipcp_propagate_stage): Update.
	* tree-emutls.c (create_emultls_var, ipa_lower_emutls): Update.
	* ipa-inline-transform.c (clone_inlined_nodes, preserve_function_body_p): Update.
	* ipa-reference.c (propagate): Update.
	(write_node_summary_p): Update.
	* toplev.c (wrapup_global_declaration_2): Update.
	* cgraphunit.c (cgraph_analyze_function): Rename to ...
	(analyze_function) ... this one.
	(cgraph_process_new_functions): Update.
	(cgraph_reset_node): Export.
	(cgraph_finalize_function): Update.
	(cgraph_add_new_function): Update.
	(process_function_and_variable_attributes): Update.
	(varpool_finalize_decl): Update.
	(symbol_finalized): Remove.
	(symbol_finalized_and_needed): Rename to ...
	(symbol_defined_and_needed): ... update.
	(cgraph_analyze_functions): Update.
	(handle_alias_pairs): Update.
	(mark_functions_to_output): Update.
	(assemble_thunk): Update.
	(output_in_order): Update.
	(output_weakrefs): Update.
	(finalize_compilation_unit): Update.
	* lto-cgraph.c (reachable_from_other_partition_p, lto_output_node,
	lto_output_varpool_node, compute_ltrans_boundary, input_overwrite_node,
	input_node, input_varpool_node): Update.
	* dbxout.c (dbxout_expand_expr): Update.
	* cgraphclones.c (cgraph_clone_node): Update.
	(cgraph_copy_node_for_versioning): Update.
	(cgraph_materialize_clone): Update.
	(cgraph_materialize_all_clones): Update.
	* ipa-pure-const.c (analyze_function, pure_const_write_summary,
	propagate_pure_const, propagate_nothrow): Update.
	* lto-streamer-out.c (lto_output, write_symbol): Update.
	* ipa-utils.c (ipa_reverse_postorder): Update.
	* ipa-inline.c (can_inline_edge_p): Update.
	(update_caller_keys, ipa_inline): Update.
	* dwarf2out.c (reference_to_unused,
	premark_types_used_by_global_vars_helper): Update.
	* tree-eh.c (tree_could_trap_p): Update.
	* ipa-split.c (consider_split, execute_split_functions): Update.
	* ipa.c (cgraph_non_local_node_p_1, cgraph_local_node_p,
	 has_addr_references_p): Update;
	move ahead in file for better readability.
	(process_references): Simplify.
	(symtab_remove_unreachable_nodes): Update; cleanup way function/var
	bodies are removed.
	(cgraph_comdat_can_be_unshared_p): Make static.
	(cgraph_externally_visible_p): Update.
	(varpool_externally_visible_p): Update.
	(function_and_variable_visibility): Update.
	* trans-mem.c (get_cg_data, ipa_tm_mayenterirr_function,
	ipa_tm_mark_force_output_node): Update.
	* ipa-inline-analysis.c (dump_inline_summary, initialize_inline_failed,
	estimate_edge_devirt_benefit, inline_generate_summary,
	inline_write_summary): Update.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Update.
	* ipa-prop.c (ipa_compute_jump_functions): Update.
	(ipa_print_node_params, ipa_prop_read_section, ipa_update_after_lto_read,
	read_replacements_section): Update.
	* varasm.c (mark_decl_referenced): Update.
	(assemble_alias, dump_tm_clone_pairs): Update.
	* tree-inline.c (copy_bb): Update.
	(estimate_num_insns, optimize_inline_calls, tree_function_versioning):
	Update.
	* symtab.c (dump_symtab_base): Print new flags.
	(verify_symtab_base): Verify new flags.
	(symtab_alias_ultimate_target): New function.
	* tree-ssa-structalias.c (get_constraint_for_ssa_var,
	create_variable_info_for, associate_varinfo_to_alias, ipa_pta_execute):
	Update.
	* passes.c (ipa_write_summaries, ipa_write_optimization_summaries): Update.
	* i386.c (ix86_get_function_versions_dispatcher,
	ix86_generate_version_dispatcher_body): Update.
	(fold_builtin_cpu): Use varpool_add_new_variable.
	* varpool.c (varpool_remove_initializer): Break out from ...
	(varpool_remove_node): ... this one.
	(dump_varpool_node, varpool_node_for_asm,
	cgraph_variable_initializer_availability, varpool_analyze_node,
	varpool_assemble_decl, varpool_remove_unreferenced_decls,
	varpool_finalize_named_section_flags, varpool_create_variable_alias): Update

	* decl.c (java_mark_decl_local): Update for new symtab flags.

	* tree.c (cp_fix_function_decl_p): Update for new symtab flags.
	* decl2.c )var_finalized_p, cp_write_global_declarations): Likewise.

	* lto.c (has_analyzed_clone_p, lto_materialize_function): Update for new symtab
	flags.
	* lto-partition.c (get_symbol_class, lto_balanced_map): Likewise.

From-SVN: r199422
2013-05-29 20:42:50 +00:00
Martin Jambor 66e6b9905b re PR lto/57084 (483. xalancbmk run fails with -O2 -flto for i686)
2013-05-09  Martin Jambor  <mjambor@suse.cz>

	PR lto/57084
	* gimple-fold.c (canonicalize_constructor_val): Call
	cgraph_get_create_real_symbol_node instead of cgraph_get_create_node.

From-SVN: r198743
2013-05-09 18:32:17 +02:00
James Greenhalgh ea679d553f [Mid-end] Add TARGET_GIMPLE_FOLD_BUILTIN target hook.
gcc/

	* coretypes.h (gimple_stmt_iterator_d): Forward declare.
	(gimple_stmt_iterator): New typedef.
	* gimple.h (gimple_stmt_iterator): Rename to...
	(gimple_stmt_iterator_d): ... This.
	* doc/tm.texi.in (TARGET_FOLD_BUILTIN): Detail restriction that
	trees be valid for GIMPLE and GENERIC.
	(TARGET_GIMPLE_FOLD_BUILTIN): New.
	* gimple-fold.c (gimple_fold_call): Call target hook
	gimple_fold_builtin.
	* hooks.c (hook_bool_gsiptr_false): New.
	* hooks.h (hook_bool_gsiptr_false): New.
	* target.def (fold_stmt): New.
	* doc/tm.texi: Regenerate.

From-SVN: r198142
2013-04-22 14:50:32 +00:00
Jakub Jelinek 9d60be3866 re PR fortran/55935 ([OOP] Fortran fronted has ADDR_EXPRs of FUNCTION_DECLs with bogus BLOCK)
PR fortran/55935
	* gimple-fold.c (get_symbol_constant_value): Call
	unshare_expr.
	(fold_gimple_assign): Don't call unshare_expr here.
	(fold_ctor_reference): Call unshare_expr.

	* trans-expr.c (gfc_conv_structure): Call
	unshare_expr_without_location on the ctor elements.

From-SVN: r195136
2013-01-13 13:33:43 +01:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Richard Biener 37376165be gimple-fold.c (fold_stmt_1): Remove code handling folding stmts away.
2012-12-06  Richard Biener  <rguenther@suse.de>

	* gimple-fold.c (fold_stmt_1): Remove code handling folding
	stmts away.

From-SVN: r194247
2012-12-06 11:00:23 +00:00
Richard Biener 381d45ed49 gimple-fold.c (fold_stmt_1): Remove unnecessary code.
2012-11-27  Richard Biener  <rguenther@suse.de>

	* gimple-fold.c (fold_stmt_1): Remove unnecessary code.

From-SVN: r193844
2012-11-27 12:06:52 +00:00
Richard Biener 77d19c725f re PR middle-end/55331 (ICE: SIGSEGV in substitute_and_fold with -O2 -fno-tree-fre)
2012-11-27  Richard Biener  <rguenther@suse.de>

	PR middle-end/55331
	* gimple-fold.c (gimplify_and_update_call_from_tree): Replace
	stmt with a NOP instead of removing it.

	* g++.dg/opt/pr55331.C: New testcase.

From-SVN: r193839
2012-11-27 09:20:02 +00:00
Eric Botcazou 506190022d re PR tree-optimization/54986 (segfault on constant initialized to object address at -O)
PR tree-optimization/54986
	* gimple-fold.c (canonicalize_constructor_val): Strip again all no-op
	conversions on entry but add them back on exit if needed.

From-SVN: r193188
2012-11-05 21:39:02 +00:00
Marc Glisse ae22ac3c62 tree.c (truth_type_for): New function.
2012-09-29  Marc Glisse  <marc.glisse@inria.fr>

	* tree.c (truth_type_for): New function.
	* tree.h (truth_type_for): Declare.
	* gimple-fold.c (and_comparisons_1): Call it.
	(or_comparisons_1): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_into_cond): Don't use
	boolean_type_node for vectors.

From-SVN: r191848
2012-09-29 08:23:23 +00:00
Marc Glisse 31ed622658 re PR c++/54427 (Expose more vector extensions)
2012-09-14  Marc Glisse  <marc.glisse@inria.fr>
	PR c++/54427

gcc/ChangeLog
	* fold-const.c (fold_unary_loc): Disable for VECTOR_TYPE.
	(fold_binary_loc): Likewise.
	* gimple-fold.c (and_comparisons_1): Handle VECTOR_TYPE.
	(or_comparisons_1): Likewise.

gcc/cp/ChangeLog
	* typeck.c (cp_build_binary_op) [LSHIFT_EXPR, RSHIFT_EXPR, EQ_EXPR,
	NE_EXPR, LE_EXPR, GE_EXPR, LT_EXPR, GT_EXPR]: Handle VECTOR_TYPE.

gcc/testsuite/ChangeLog
	* g++.dg/other/vector-compare.C: New testcase.
	* gcc/testsuite/c-c++-common/vector-compare-3.c: New testcase.
	* gcc.dg/vector-shift.c: Move ...
	* c-c++-common/vector-shift.c: ... here.
	* gcc.dg/vector-shift1.c: Move ...
	* c-c++-common/vector-shift1.c: ... here.
	* gcc.dg/vector-shift3.c: Move ...
	* c-c++-common/vector-shift3.c: ... here.
	* gcc.dg/vector-compare-1.c: Move ...
	* c-c++-common/vector-compare-1.c: ... here.
	* gcc.dg/vector-compare-2.c: Move ...
	* c-c++-common/vector-compare-2.c: ... here.
	* gcc.c-torture/execute/vector-compare-1.c: Move ...
	* c-c++-common/torture/vector-compare-1.c: ... here.
	* gcc.c-torture/execute/vector-compare-2.x: Delete.
	* gcc.c-torture/execute/vector-compare-2.c: Move ...
	* c-c++-common/torture/vector-compare-2.c: ... here.
	* gcc.c-torture/execute/vector-shift.c: Move ...
	* c-c++-common/torture/vector-shift.c: ... here.
	* gcc.c-torture/execute/vector-shift2.c: Move ...
	* c-c++-common/torture/vector-shift2.c: ... here.
	* gcc.c-torture/execute/vector-subscript-1.c: Move ...
	* c-c++-common/torture/vector-subscript-1.c: ... here.
	* gcc.c-torture/execute/vector-subscript-2.c: Move ...
	* c-c++-common/torture/vector-subscript-2.c: ... here.
	* gcc.c-torture/execute/vector-subscript-3.c: Move ...
	* c-c++-common/torture/vector-subscript-3.c: ... here.

From-SVN: r191308
2012-09-14 17:17:01 +00:00
Richard Guenther 5a27a197d8 re PR middle-end/54515 (cc1plus sigsegv -O2 anonymous namespace)
2012-09-11  Richard Guenther  <rguenther@suse.de>

	PR middle-end/54515
	* gimple.c (get_base_address): Do not return NULL_TREE apart
	from for WITH_SIZE_EXPR.
	* gimple-fold.c (canonicalize_constructor_val): Do not call
	get_base_address when not necessary.

	* g++.dg/tree-ssa/pr54515.C: New testcase.

From-SVN: r191174
2012-09-11 08:32:29 +00:00
Lawrence Crowl 27bcd47cfa Modify gcc/*.[hc] double_int call sites to use the new interface.
This change entailed adding a few new methods to double_int.

The change results in a 0.163% time improvement with a 70% confidence.

Tested on x86_64.


Index: gcc/ChangeLog

2012-09-06  Lawrence Crowl  <crowl@google.com>

	* double-int.h (double_int::operator &=): New.
	(double_int::operator ^=): New.
	(double_int::operator |=): New.
	(double_int::mul_with_sign): Modify overflow parameter to bool*.
	(double_int::add_with_sign): New.
	(double_int::ule): New.
	(double_int::sle): New.
	(binary double_int::operator *): Remove parameter name.
	(binary double_int::operator +): Likewise.
	(binary double_int::operator -): Likewise.
	(binary double_int::operator &): Likewise.
	(double_int::operator |): Likewise.
	(double_int::operator ^): Likewise.
	(double_int::and_not): Likewise.
	(double_int::from_shwi): Tidy formatting.
	(double_int::from_uhwi): Likewise.
	(double_int::from_uhwi): Likewise.
	* double-int.c (double_int::mul_with_sign): Modify overflow parameter
	to bool*.
	(double_int::add_with_sign): New.
	(double_int::ule): New.
	(double_int::sle): New.
	* builtins.c: Modify to use the new double_int interface.
	* cgraph.c: Likewise.
	* combine.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimplify-rtx.c: Likewise.
	* ipa-prop.c: Likewise.
	* loop-iv.c: Likewise.
	* optabs.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-object-size.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-sccvn: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.h: Likewise.
	* tree.c: Likewise.
	* varasm.c: Likewise.

From-SVN: r191047
2012-09-07 00:06:35 +00:00
Richard Guenther 491e0b9b0c re PR middle-end/54327 (Segmentation fault in init_ggc)
2012-08-20  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/54327
	* gimple-fold.c (get_maxval_strlen): Do not walk use-def chains
	if the use is registered for SSA update.

	* gcc.dg/torture/pr54327.c: New testcase.

From-SVN: r190528
2012-08-20 10:26:45 +00:00
Richard Guenther 46eb666a79 tree-dfa.c (referenced_var_lookup): Remove.
2012-08-02  Richard Guenther  <rguenther@suse.de>

	* tree-dfa.c (referenced_var_lookup): Remove.
	(find_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	(make_rename_temp): Do not add referenced vars.
	(dump_referenced_vars): Remove.
	(debug_referenced_vars): Likewise.
	(dump_dfa_stats): Do not dump referenced var stats.
	(find_vars_r): Remove.
	(find_referenced_vars_in): Likewise.
	(referenced_var_check_and_insert): Likewise.
	(add_referenced_var_1): Likewise.
	(remove_referenced_var): Likewise.
	* tree-flow.h (referenced_var_lookup): Likewise.
	(struct gimple_df): Remove referenced_vars member.
	(typedef referenced_var_iterator): Remove.
	(FOR_EACH_REFERENCED_VAR): Likewise.
	(num_referenced_vars): Likewise.
	(debug_referenced_vars, dump_referenced_vars): Likewise.
	(add_referenced_var_1, add_referenced_var): Likewise.
	(remove_referenced_var): Likewise.
	(find_referenced_vars_in): Likewise.
	* tree-flow-inline.h (gimple_referenced_vars): Remove.
	(first_referenced_var): Likewise.
	(end_referenced_vars_p): Likewise.
	(next_referenced_var): Likewise.
	* cfgexpand.c (update_alias_info_with_stack_vars): Remove assert.
	* gimple-pretty-print.c (pp_points_to_solution): Dump UIDs
	unconditionally.
	* tree-into-ssa.c (dump_decl_set): Likewise.
	(pass_build_ssa): Do not require PROP_referenced_vars.
	* tree-ssa.c (target_for_debug_bind): Virtual operands are
	not suitable, but all register type vars are.
	(init_tree_ssa): Do not allocate referenced vars.
	(delete_tree_ssa): Do not free referenced vars.
	* cgraphunit.c (init_lowered_empty_function): Do not set
	PROP_referenced_vars.
	(assemble_thunk): Do not add referenced vars.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	(gimplify_and_update_call_from_tree): Likewise.
	* gimple-streamer-in.c (input_bb): Likewise.
	* passes.c (init_optimization_passes): Do not run
	pass_referenced_vars.
	(dump_properties): Do not dump PROP_referenced_vars.
	* tree-inline.c (remap_decl): Do not add referenced vars.
	(remap_gimple_op_r): Likewise.
	(copy_tree_body_r): Likewise.
	(copy_bb): Likewise.
	(setup_one_parameter): Likewise.
	(declare_return_variable): Likewise.
	(copy_decl_for_dup_finish): Likewise.
	(copy_arguments_for_versioning): Likewise.
	(tree_function_versioning): Likewise.
	* tree-pass.h (PROP_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	* tree-profile.c (gimple_gen_edge_profiler): Do not add referenced vars.
	(gimple_gen_interval_profiler): Likewise.
	(gimple_gen_pow2_profiler): Likewise.
	(gimple_gen_one_value_profiler): Likewise.
	(gimple_gen_ic_profiler): Likewise.
	(gimple_gen_average_profiler): Likewise.
	(gimple_gen_ior_profiler): Likewise.
	* tree-ssa-live.c (remove_unused_locals): Do not touch referenced vars.
	* tree-cfg.c (replace_ssa_name): Do not add referenced vars.
	(move_stmt_op): Likewise.
	* tree-ssa-operands.c (create_vop_var): Likewise.
	* gimple-low.c (record_vars_into): Likewise.
	* gimplify.c (gimple_regimplify_operands): Likewise.
	(force_gimple_operand_1): Likewise.
	* omp-low.c (expand_omp_for_generic): Likewise.
	(expand_omp_for_static_chunk): Likewise.
	(expand_omp_atomic_pipeline): Likewise.
	* graphite-clast-to-gimple.c (graphite_create_new_loop): Likewise.
	(translate_clast_assignment): Likewise.
	* graphite-sese-to-poly.c (create_zero_dim_array): Likewise.
	(handle_scalar_deps_crossing_scop_limits): Likewise.
	* ipa-prop.c (ipa_modify_formal_parameters): Likewise.
	* ipa-split.c (split_function): Likewise.
	* matrix-reorg.c (transform_access_sites): Likewise.
	* trans-mem.c (tm_log_add): Likewise.
	(ipa_tm_insert_gettmclone_call): Likewise.
	* tree-complex.c (create_one_component_var): Likewise.
	* tree-if-conv.c (ifc_temp_var): Likewise.
	* tree-parloops.c (take_address_of): Likewise.
	(initialize_reductions): Likewise.
	(separate_decls_in_region_name): Likewise.
	(create_call_for_reduction_1): Likewise.
	(separate_decls_in_region): Likewise.
	* tree-predcom.c (predcom_tmp_var): Likewise.
	(reassociate_to_the_same_stmt): Likewise.
	* tree-sra.c (build_ref_for_offset): Likewise.
	(create_access_replacement): Likewise.
	(get_replaced_param_substitute): Likewise.
	(sra_ipa_reset_debug_stmts): Likewise.
	* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise.
	(rewrite_bittest): Likewise.
	* tree-ssa-loop-ivopts.c (create_new_iv): Likewise.
	* tree-ssa-loop-manip.c (create_iv): Likewise.
	(tree_transform_and_unroll_loop): Likewise.
	* tree-ssa-math-opts.c (powi_as_mults): Likewise.
	(build_and_insert_call): Likewise.
	(gimple_expand_builtin_cabs): Likewise.
	(execute_optimize_bswap): Likewise.
	* tree-ssa-phiopt.c (conditional_replacement): Likewise.
	(abs_replacement): Likewise.
	(cond_store_replacement): Likewise.
	(cond_if_else_store_replacement_1): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
	* tree-ssa-pre.c (get_representative_for): Likewise.
	(create_expression_by_pieces): Likewise.
	(insert_into_preds_of_block): Likewise.
	* tree-ssa-propagate.c (update_call_from_tree): Likewise.
	* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
	(eliminate_redundant_comparison): Likewise.
	(rewrite_expr_tree_parallel): Likewise.
	(get_reassoc_pow_ssa_name): Likewise.
	* tree-ssa-strlen.c (get_string_length): Likewise.
	* tree-switch-conversion.c (emit_case_bit_tests): Likewise.
	(build_arrays): Likewise.
	* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
	(create_tailcall_accumulator): Likewise.
	* tree-vect-data-refs.c (vect_get_new_vect_var): Likewise.
	(vect_create_addr_base_for_vector_ref): Likewise.
	(vect_permute_store_chain): Likewise.
	(vect_permute_load_chain): Likewise.
	* tree-vect-generic.c (expand_vector_divmod): Likewise.
	* tree-vect-loop-manip.c (set_prologue_iterations): Likewise.
	(vect_build_loop_niters): Likewise.
	(vect_generate_tmps_on_preheader): Likewise.
	(vect_update_ivs_after_vectorizer): Likewise.
	(vect_gen_niters_for_prolog_loop): Likewise.
	(vect_do_peeling_for_alignment): Likewise.
	(vect_create_cond_for_align_checks): Likewise.
	* tree-vect-patterns.c (vect_recog_temp_ssa_var): Likewise.
	(vect_handle_widen_op_by_const): Likewise.
	(vect_operation_fits_smaller_type): Likewise.
	(vect_recog_over_widening_pattern): Likewise.
	* tree-vect-stmts.c (vect_init_vector): Likewise.

	* gcc.dg/torture/pta-callused-1.c: Adjust.
	* gcc.dg/torture/pta-ptrarith-3.c: Likewise.
	* gcc.dg/torture/ssa-pta-fn-1.c: Likewise.
	* gcc.dg/tree-ssa/alias-19.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-1.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-2.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-3.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.

From-SVN: r190067
2012-08-02 08:14:54 +00:00
Eric Botcazou a3628196ec gimple-fold.c (canonicalize_constructor_val): Strip only useless type conversions.
* gimple-fold.c (canonicalize_constructor_val): Strip only useless type
	conversions.

From-SVN: r189685
2012-07-19 21:22:04 +00:00
Steven Bosscher 7ee2468b92 system.h (dump_file): Do not define.
gcc/
	* system.h (dump_file): Do not define.
	* tree-pass.h: Include dumpfile.h, which is a new file containing...
	(enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p,
	dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p,
	dump_flag_name, dump_file, dump_flags, dump_file_name,
	get_dump_file_info, struct dump_file_info): all of this, moved to...
	* dumpfile.h: Here, new file.
	* tree-dump.h: Include dumpfile.h, but not tree-pass.h.
	(dump_stmt): Remove prototype for C++ specific function.
	(dump_enumerated_decls): Move prototype from here...
	* tree-flow.h (dump_enumerated_decls): ... to here.
	(get_ref_base_and_extent) Move prototype from here ...
	* tree.h (get_ref_base_and_extent) ... to here.
	* tree-ssa-live.c: Do not inclde tree-pretty-print.h, because
	gimple-pretty-print.h is enough.  Do not include tree-dump.h,
	include timevar.h and dumpfile.h instead.
	(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls): Move from here ...
	* tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls):... to here.
	Do not include timevar.h.
	* tree.c: Do not include timevar.h.
	* tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and
	timevar.h.
	(dump_cfg_stats): Use current_function_name.
	(gimple_cfg2vcg): Likewise.
	(dump_function_to_file): Likewise.
	* df-scan.c: Do not include tree-pass.h and timevar.h.
	Include dumpfile.h.
	(df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not
	use print_current_pass.
	* df-problems.c: Include dumpfile.h.
	Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it
	leads to errors in the code not selected.
	(df_note_compute): Do not print_rtl_with_bb here.  Fix compilation
	bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here.
	* lcm.c: Include dumpfile.h.
	Remove obsolete include of insn-attr.h.
	* dojump.c (do_compare_rtx_and_jump): Remove failure printing for
	missing probability notes.
	* stmt.c: Include dumpfile.h.
	(emit_case_decision_tree): Re-enable printing expand details only
	if TDF_DETAILS.
	* alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, 
	cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, 
	cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, 
	coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, 
	dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, 
	function.c, fwprop.c, gcse.c, gimple-fold.c, 
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, 
	gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, 
	graphite-dependences.c, graphite-interchange.c, 
	graphite-optimize-isl.c, graphite-poly.c, 
	graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, 
	ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, 
	ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, 
	ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, 
	jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, 
	loop-unroll.c, loop-unswitch.c, lower-subreg.c, 
	lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, 
	mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, 
	plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, 
	print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, 
	regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, 
	sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, 
	store-motion.c, tracer.c, trans-mem.c, tree-affine.c, 
	tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, 
	tree-data-ref.c, tree-diagnostic.c, tree-dump.c,
	tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, 
	tree-mudflap.c, tree-nrv.c, tree-object-size.c, 
	tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, 
	tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, 
	tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, 
	tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, 
	tree-ssa-copyrename.c,, tree-ssa-dce.c, tree-ssa-dom.c, 
	tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, 
	tree-ssa-loop.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, 
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, 
	tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, 
	tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, 
	tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, 
	tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, 
	tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, 
	tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, 
	tree-ssa-threadedge.c, tree-ssa-threadupdate.c, 
	tree-ssa-uncprop.c, tree-ssa-uninit.c, 
	tree-switch-conversion.c, tree-tailcall.c, 
	tree-vect-data-refs.c, tree-vect-loop.c, 
	tree-vect-loop-manip.c, tree-vectorizer.c, 
	tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, 
	tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h
	only if needed.  If tree-pass.h is included, do not include timevar.h
	and dumpfile.h.  If tree-pass.h is not included but dump_file, or
	dump_flags, or the TDF_* flags are used, include dumpfile.h.
	If gimple-pretty-print.h is included, don't include tree-pretty-print.h.
	Remove assorted unnecessary includes.

	* config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/spu/spu.c, config/mep/mep.c, config/i386/i386.c:
	Include dumpfile.h.
	* config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h.
	* arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep,
	spu/t-spu-elf: Fix dependencies.

c-family/
	* c-gimplify.c: Include dumpfile.h instead of tree-dump.h.
	* c-ada-spec.c: Likewise.
	* c-dump.c (dump_stmt): Move to cp/dump.c, the only user.

c/
	* c-decl.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

cp/
	* dump.c (dump_stmt): Moved here from c-dump.c.
	* optimize.c: Include dumpfile.h instead of tree-dump.h.
	* class.c: Likewise.
	* decl2.c: Likewise.
	* Make-lang.in: Fix dependencies.

fortran/
	* f95-lang.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

java/
	* java-gimplify.c Include dumpfile.h instead of tree-dump.h
	* Make-lang.in: Fix dependencies.

lto/
	* lto.c: Do not include timevar.h.
	* Make-lang.in: Fix dependencies.

ada/
	* gcc-interface/utils.c: Include timevar.h.
	* Make-lang.in: Fix dependencies.

From-SVN: r189519
2012-07-16 11:32:42 +00:00
Richard Guenther 23af816cc9 re PR middle-end/53433 (ICE in int_mode_for_mode, at stor-layout.c:424 during lto-bootstrap)
2012-07-04  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53433
	* gimple-fold.c (get_base_constructor): Do not return an
	error_mark_node DECL_INITIAL.

From-SVN: r189260
2012-07-04 13:47:18 +00:00
Michael Matz 6da8be895c gimplify.c (gimplify_modify_expr): Fold generated statements.
* gimplify.c (gimplify_modify_expr): Fold generated statements.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Check flag_ltrans.

testsuite/
	* gcc.dg/debug/dwarf2/inline3.c: Adjust.
	* gcc.dg/tree-ssa/foldstring-1.c: Adjust.

From-SVN: r188664
2012-06-15 14:40:38 +00:00
Michael Matz ca5f433123 expr.c (expand_expr_real_1 <normal_inner_ref>): Don't allocate a kept temp.
* expr.c (expand_expr_real_1 <normal_inner_ref>): Don't allocate
	a kept temp.
	(expand_expr_real_1 <COMPOUND_LITERAL_EXPR>): Make unreachable.
	* gimple-fold.c (canonicalize_constructor_val): Canonicalize 
	COMPOUND_LITERAL_EXPR.
	* function.c (expand_function_start): Don't call expand_decl,
	instead assert that we have RTL assigned.
	* tree-ssa-live.c (remove_unused_locals): Clear
	nonlocal_goto_save_area if its backing variable is removed.
	* stmt.c (expand_asm_operands): Remove handling of non-lvalues
	as mem inputs.
	(expand_decl): Assert that this does nothing.
	* calls.c (expand_call): Don't call mark_temp_addr_taken.

	* c-tree.h (c_expand_decl): Remove prototype.

c-family/
	* c-common.h (c_expand_decl): Remove prototype.

ada/
	* gcc-interface/utils.c (create_var_decl_1): Don't call expand_decl.

From-SVN: r187962
2012-05-29 14:41:53 +00:00
Joseph Myers 073a899888 LANGUAGES: Fix typos.
* LANGUAGES: Fix typos.
	* Makefile.in: Fix typos.
	* alias.c: Fix typos.
	* auto-inc-dec.c: Fix typos.
	* bb-reorder.c: Fix typos.
	* cfgcleanup.c: Fix typos.
	* cgraph.c: Fix typos.
	* cgraph.h: Fix typos.
	* cgraphunit.c: Fix typos.
	* collect2-aix.h: Fix typos.
	* collect2.c: Fix typos.
	* compare-elim.c: Fix typos.
	* config/alpha/vms.h: Fix typos.
	* config/arm/README-interworking: Fix typos.
	* config/arm/arm.c: Fix typos.
	* config/arm/iterators.md: Fix typos.
	* config/arm/vxworks.h: Fix typos.
	* config/avr/avr.c: Fix typos.
	* config/avr/avr.h: Fix typos.
	* config/avr/avr.md: Fix typos.
	* config/avr/builtins.def: Fix typos.
	* config/c6x/c6x.c: Fix typos.
	* config/cr16/cr16.c: Fix typos.
	* config/cr16/cr16.md: Fix typos.
	* config/cris/cris.md: Fix typos.
	* config/darwin.c: Fix typos.
	* config/darwin.opt: Fix typos.
	* config/i386/i386-c.c: Fix typos.
	* config/i386/i386.c: Fix typos.
	* config/ia64/ia64.c: Fix typos.
	* config/m68k/cf.md: Fix typos.
	* config/mep/mep.c: Fix typos.
	* config/microblaze/microblaze.c: Fix typos.
	* config/microblaze/microblaze.h: Fix typos.
	* config/mn10300/mn10300.c: Fix typos.
	* config/mn10300/mn10300.md: Fix typos.
	* config/pa/pa.c: Fix typos.
	* config/picochip/picochip.h: Fix typos.
	* config/rs6000/a2.md: Fix typos.
	* config/rs6000/rs6000.c: Fix typos.
	* config/rs6000/vector.md: Fix typos.
	* config/rx/rx.md: Fix typos.
	* config/rx/rx.opt: Fix typos.
	* config/s390/2097.md: Fix typos.
	* config/s390/s390.c: Fix typos.
	* config/s390/s390.h: Fix typos.
	* config/sh/sh.c: Fix typos.
	* config/sh/sh.md: Fix typos.
	* config/sparc/sync.md: Fix typos.
	* config/spu/spu.c: Fix typos.
	* config/spu/spu.md: Fix typos.
	* config/vms/vms.c: Fix typos.
	* config/vxworks-dummy.h: Fix typos.
	* config/vxworks.h: Fix typos.
	* cselib.c: Fix typos.
	* df-scan.c: Fix typos.
	* df.h: Fix typos.
	* doc/extend.texi: Fix typos.
	* doc/install.texi: Fix typos.
	* doc/invoke.texi: Fix typos.
	* doc/md.texi: Fix typos.
	* doc/plugins.texi: Fix typos.
	* doc/rtl.texi: Fix typos.
	* dse.c: Fix typos.
	* dwarf2asm.c: Fix typos.
	* dwarf2out.c: Fix typos.
	* except.h: Fix typos.
	* expr.c: Fix typos.
	* fold-const.c: Fix typos.
	* gcc.c: Fix typos.
	* gcse.c: Fix typos.
	* genautomata.c: Fix typos.
	* gengtype-state.c: Fix typos.
	* gengtype.c: Fix typos.
	* genhooks.c: Fix typos.
	* gimple-fold.c: Fix typos.
	* gimple-pretty-print.c: Fix typos.
	* gimple.c: Fix typos.
	* gimple.h: Fix typos.
	* gimplify.c: Fix typos.
	* graphite-interchange.c: Fix typos.
	* graphite-sese-to-poly.c: Fix typos.
	* ifcvt.c: Fix typos.
	* input.c: Fix typos.
	* ipa-cp.c: Fix typos.
	* ipa-inline-analysis.c: Fix typos.
	* ipa-inline-transform.c: Fix typos.
	* ipa-inline.c: Fix typos.
	* ipa-pure-const.c: Fix typos.
	* ipa-ref.h: Fix typos.
	* ipa-reference.c: Fix typos.
	* ipa-utils.c: Fix typos.
	* ipa.c: Fix typos.
	* ira-emit.c: Fix typos.
	* ira-lives.c: Fix typos.
	* lto-streamer.c: Fix typos.
	* lto-streamer.h: Fix typos.
	* lto-wrapper.c: Fix typos.
	* mcf.c: Fix typos.
	* mode-switching.c: Fix typos.
	* modulo-sched.c: Fix typos.
	* plugin.c: Fix typos.
	* postreload.c: Fix typos.
	* sched-deps.c: Fix typos.
	* sel-sched-ir.c: Fix typos.
	* sel-sched-ir.h: Fix typos.
	* sel-sched.c: Fix typos.
	* sese.c: Fix typos.
	* stor-layout.c: Fix typos.
	* target-hooks-macros.h: Fix typos.
	* target.def: Fix typos.
	* trans-mem.c: Fix typos.
	* tree-eh.c: Fix typos.
	* tree-predcom.c: Fix typos.
	* tree-sra.c: Fix typos.
	* tree-ssa-address.c: Fix typos.
	* tree-ssa-loop-ivopts.c: Fix typos.
	* tree-ssa-loop-niter.c: Fix typos.
	* tree-ssa-math-opts.c: Fix typos.
	* tree-ssa-pre.c: Fix typos.
	* tree-ssa-propagate.c: Fix typos.
	* tree-ssa-reassoc.c: Fix typos.
	* tree-ssa-sccvn.c: Fix typos.
	* tree-ssa-ter.c: Fix typos.
	* tree-ssa-uninit.c: Fix typos.
	* tree-ssanames.c: Fix typos.
	* tree-vect-generic.c: Fix typos.
	* tree-vect-slp.c: Fix typos.
	* tree.c: Fix typos.
	* tree.h: Fix typos.
	* varasm.c: Fix typos.
	* varpool.c: Fix typos.

From-SVN: r187959
2012-05-29 15:14:06 +01:00
Richard Guenther 0faa05629e tree-flow.h (create_var_ann): Remove.
2012-05-24  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (create_var_ann): Remove.
	* tree-dfa.c (create_var_ann): Remove and inline into its
	single caller ...
	(add_referenced_var_1): ... here.
	* varpool.c (add_new_static_var): Do not call add_referenced_var
	for global vars.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	* tree-switch-conversion.c (build_one_array): Likewise.
	* tree-profile.c (gimple_gen_ic_profiler): Likewise.
	* tree-flow-inline.h (gimple_referenced_vars): Guard against
	NULL fn argument.
	* tree-inline.c (remap_gimple_op_r): Likewise.  Check
	gimple_referenced_vars instead of gimple_in_ssa_p.
	(copy_tree_body_r): Likewise.
	(setup_one_parameter): Likewise.
	(declare_return_variable): Likewise.
	(tree_function_versioning): Likewise.

From-SVN: r187829
2012-05-24 12:33:49 +00:00
Jan Hubicka c44c2088f7 cgraphbuild.c (record_reference): Update.
* cgraphbuild.c (record_reference): Update.
	* lto-cgraph.c (lto_output_varpool_node): External vars
	are not in other partition even if they are not output
	in current partition.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Take FROM_DECL
	argument; fix.
	(canonicalize_constructor_val): Take FROM_DECL argument.
	(fold_ctor_reference, fold_string_cst_ctor_reference,
	fold_array_ctor_reference, fold_nonarray_ctor_reference,
	fold_ctor_reference): Likewise.
	(fold_const_aggregate_ref_1, gimple_get_virt_method_for_binfo): Update.
	* gimple.h (gimple_fold_builtin): Likewise.

From-SVN: r187678
2012-05-19 09:49:47 +00:00
Jan Hubicka 6649df51ec lto-symtab.c (lto_symtab_resolve_symbols): Preffer decl with constructor over decl without.
* lto-symtab.c (lto_symtab_resolve_symbols): Preffer decl with constructor
	over decl without.
	* cgraph.c (cgraph_remove_node): Clear also body of unanalyzed nodes.
	* cgraph.h (varpool_can_remove_if_no_refs): Handle external correctly.
	* cgraphunit.c (process_function_and_variable_attributes): Finalize 
	extrnal decls.
	(mark_functions_to_output): Also accept bodies for functions with clones.
	(output_in_order): Skip external vars.
	* lto-cgraph.c (lto_output_node): External functions are never in other
	partition.
	(lto_output_varpool_node): Likewise.
	* lto-streamer-out.c (lto_write_tree): Always use error_mark_nodes for
	forgotten initializers.
	* ipa.c (process_references): Handle external vars.
	(symtab_remove_unreachable_nodes): Update to handle external vars.
	(varpool_externally_visible_p): External vars are externally visible.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Update.
	* varpool.c (varpool_remove_node): Remove constructor.
	(decide_is_variable_needed): Handle externals.
	(varpool_remove_unreferenced_decls): Likewise.

	* lto-partition.c (add_references_to_partition): Handle external vars.
	(partition_varpool_node_p): Likewise.
	(lto_promote_cross_file_statics): Do not promote externals.

From-SVN: r187631
2012-05-17 16:37:33 +00:00
Andrew Pinski 763dc99dd3 gimple-fold.c (get_maxval_strlen): Move COND_EXPR handling under GIMPLE_ASSIGN.
2012-05-16  Andrew Pinski  <apinski@cavium.com>

	* gimple-fold.c (get_maxval_strlen): Move COND_EXPR handling under
	GIMPLE_ASSIGN.

From-SVN: r187608
2012-05-16 13:22:03 -07:00
Richard Guenther 835c9db01f tree-flow.h (referenced_var_check_and_insert): Remove.
2012-05-11  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (referenced_var_check_and_insert): Remove.
	(find_new_referenced_vars): Likewise.
	* tree-dfa.c (referenced_var_check_and_insert): Make static.
	(find_new_referenced_vars_1, find_new_referenced_vars): Remove.
	* tree-inline.c (copy_bb): Use find_referenced_vars_in
	instead of find_new_referenced_vars.
	* gimple-fold.c (gimplify_and_update_call_from_tree): Likewise.

From-SVN: r187408
2012-05-11 14:08:30 +00:00
Eric Botcazou b48e22b2bd tree-dfa.c (get_ref_base_and_extent): Do the offset computation using the precision of the index type.
* tree-dfa.c (get_ref_base_and_extent) <ARRAY_REF>: Do the offset
	computation using the precision of the index type.
	* gimple-fold.c (fold_const_aggregate_ref_1) <ARRAY_REF>: Likewise.
	(fold_array_ctor_reference): Do index computations in the index type.

From-SVN: r187268
2012-05-07 18:57:23 +00:00
Michael Matz 355a767352 coretypes.h (gimple_seq, [...]): Typedef as gimple.
* coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple.
	* gimple.h (struct gimple_seq_node_d, struct gimple_seq_d): Remove.
	(const_gimple_seq_node): Remove.
	(gimple_seq_node): Typedef as gimple.
	(struct gimple_statement_base): Add next and prev members,
	adjust all WORD markers in using structs.
	(union gimple_statement_d): Link via gsbase.next field for GC and PCH.
	(gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
	gimple_seq_last_stmt): Adjust as gimple_seq, gimple_seq_node and
	gimple are the same.
	(gimple_seq_set_last, gimple_seq_set_first): Don't allocate
	gimple_seq, adjust.
	(gimple_init_singleton): New function.
	(gsi_start_1, gsi_last_1, gsi_end_p, gsi_one_before_end_p): Adjust.
	(gsi_next, gsi_prev): Adjust, handle prev cyclic list correctly.
	(gsi_stmt): Adjust.
	(gsi_stmt_ptr): Remove.
	(enum gimple_alloc_kind): Remove gimple_alloc_kind_seq member.

	* gimple-iterator.c (update_bb_for_stmts): Take last parameter
	again, adjust for above changes.
	(update_call_edge_frequencies): Adjust for above changes.
	(gsi_insert_seq_nodes_before): Rewrite for new data structure.
	(gsi_insert_seq_nodes_after): Ditto.
	(gsi_split_seq_after): Ditto.
	(gsi_set_stmt): Ditto.
	(gsi_split_seq_before): Ditto.
	(gsi_remove): Ditto.
	(gsi_insert_seq_before_without_update): Don't free sequence.
	(gsi_insert_seq_after_without_update): Ditto.
	(gsi_replace): Assert some more invariants.
	(gsi_insert_before_without_update, gsi_insert_after_without_update):
	Tidy.
	(gsi_for_stmt): Don't search for stmt.
	(gsi_insert_on_edge_immediate): Tidy.

	* gimple.c (gimple_alloc_k): Remove "sequences".
	(gimple_seq_cache): Remove.
	(gimple_alloc_stat): Make stmt a singleton sequence.
	(gimple_seq_alloc, gimple_seq_free): Remove.
	(gimple_assign_set_rhs_with_ops_1): Ensure new stmt is a singleton.
	(gimple_copy): Ditto.
	* gimplify.c (gimplify_cleanup_point_expr): Use gsi_set_stmt,
	create iterator from correct sequence.
	* tree-phinodes.c (make_phi_node): Make stmt a singleton.


	* gimple.h (gimple_stmt_iterator <seq>): Make it be pointer to
	gimple_seq.
	(gimple_seq_set_last, gimple_seq_set_first): Take pointer to
	sequence, lazily allocate it.
	(bb_seq_addr): New function.
	(gsi_start_1): Rename from gsi_start, but take pointer to sequence.
	(gsi_start): Macro to wrap gsi_start_1 taking pointer of argument.
	(gsi_none): New function.
	(gsi_start_bb): Adjust.
	(gsi_last_1): Rename from gsi_last, but take pointer to sequence.
	(gsi_last): Macro to wrap gsi_last_1 taking pointer of argument.
	(gsi_last_bb): Adjust.
	(gsi_seq): Adjust.
	* tree-flow-inline.h (phi_nodes_ptr): New function.

	* gimple-iterator.c (gsi_insert_seq_nodes_before): Adjust to 
	datastructure and interface change.
	(gsi_insert_seq_before_without_update): Ditto.
	(gsi_insert_seq_nodes_after): Ditto.
	(gsi_insert_seq_after_without_update): Ditto.
	(gsi_split_seq_after): Ditto, don't use gimple_seq_alloc.
	(gsi_split_seq_before): Ditto.
	(gsi_start_phis): Adjust.
	* tree-vect-loop.c (vect_determine_vectorization_factor): Use
	gsi_none.
	(vect_transform_loop): Ditto.
	* gimple.c (gimple_seq_add_stmt, gimple_seq_add_seq,
	gimple_seq_copy): Don't use gimple_seq_alloc.
	* gimplify.c (gimple_seq_add_stmt_without_update): Ditto.
	(gimplify_seq_add_seq): Ditto.
	* lto-streamer-in.c (make_new_block): Ditto.
	* tree-cfg.c (create_bb): Ditto.
	* tree-sra.c (initialize_parameter_reductions): Ditto.


	* gimple.h (gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
	gimple_seq_last_stmt, gimple_seq_set_last, gimple_seq_set_first,
	gimple_seq_empty_p, gimple_seq_alloc_with_stmt, bb_seq,
	set_bb_seq): Move down to after gimple_statement_d definition.


	* gimple-fold.c (gimplify_and_update_call_from_tree): Use
	gsi_replace_with_seq, instead of inserting itself.
	* gimple-iterator.c (gsi_replace_with_seq): New function.
	* tree-ssa-forwprop.c (forward_propagate_comparison): Take
	iterator instead of statement, advance it.
	(ssa_forward_propagate_and_combine): Adjust call to above.


	* tree-phinodes.c (add_phi_node_to_bb): Tidy, don't use
	gimple_seq_alloc.
	* omp-low.c (finalize_task_copyfn): Don't use gimple_seq_alloc.
	* tree-nested.c (walk_gimple_omp_for): Ditto.
	* trans-mem.c (lower_transaction): Ditto.
	* tree-eh.c (do_return_redirection): Ditto.
	(do_goto_redirection): Ditto.
	(lower_try_finally_switch): Ditto.
	* gimplify.c (gimplify_stmt): Ditto.
	(gimplify_scan_omp_clauses): Ditto.
	(gimplify_omp_for): Ditto.
	(gimplify_function_tree): Ditto.
	* gimple-fold.c (gimplify_and_update_call_from_tree): Ditto.
	* tree-mudflap.c (mf_decl_cache_locals): Ditto.
	(mf_build_check_statement_for): Ditto.
	(mx_register_decls): Ditto.
	* graphite-sese-to-poly.c (remove_invariant_phi): Ditto,
	and don't use itertors to append.
	(insert_stmts): Ditto.
	(insert_out_of_ssa_copy): Ditto.
	(insert_out_of_ssa_copy_on_edge): Ditto.


	* gimple.h (gimple_bind_body_ptr): New function.
	(gimple_bind_body): Use it.
	(gimple_catch_handler): Use gimple_catch_handler_ptr.
	(gimple_eh_filter_failure_ptr): New function.
	(gimple_eh_filter_failure): Use it.
	(gimple_eh_else_n_body_ptr): New function.
	(gimple_eh_else_n_body): Use it.
	(gimple_eh_else_e_body_ptr): New function.
	(gimple_eh_else_e_body): Use it.
	(gimple_try_eval_ptr): New function.
	(gimple_try_eval): Use it.
	(gimple_try_cleanup_ptr): New function.
	(gimple_try_cleanup): Use it.
	(gimple_wce_cleanup_ptr): New function.
	(gimple_wce_cleanup): Use it.
	(gimple_omp_body_ptr): New function.
	(gimple_omp_body): Use it.
	(gimple_omp_for_pre_body_ptr): New function.
	(gimple_omp_for_pre_body): Use it.
	(gimple_transaction_body_ptr): New function.
	(gimple_transaction_body): Use it.
	(gsi_split_seq_before): Adjust to return nothing and take pointer
	to sequence.
	(gsi_set_stmt): Declare.
	(gsi_replace_with_seq): Declare.
	(walk_gimple_seq_mod): Declare.
	* function.h (struct function <gimple_body>): Use typedef gimple_seq.

	* gimple-iterator.c (gsi_set_stmt): New function.
	(gsi_split_seq_before): Return new sequence via pointer argument.
	(gsi_replace): Use gsi_set_stmt.

	* tree-ssa-loop-im.c (move_computations_stmt): First remove
	then insert stmt.
	* tree-complex.c (update_complex_components_on_edge): Don't
	copy gsi.
	* tree-phinodes.c (resize_phi_node): Don't resize stmt in-place,
	return new stmt.
	(reserve_phi_args_for_new_edge): Change call to above,
	use gsi_set_stmt.

	* omp-low.c (lower_omp): Change prototype to take pointer to
	sequence.
	(lower_rec_input_clauses): Use gimple_seq_add_seq instead of
	iterators.  Adjust call to lower_omp.
	(lower_lastprivate_clauses): Adjust call to lower_omp.
	(lower_reduction_clauses): Ditto.
	(expand_omp_taskreg): Nullify non-cfg body of child_fn.
	(lower_omp_sections): Don't explicitely count sequence length,
	nullify lowered bodies earlier, ensure stmts are part of only
	one sequence, adjust call to lower_omp.
	(lower_omp_single): Ensure stmts are part of only one sequence,
	adjust call to lower_omp.
	(lower_omp_master): Ditto.
	(lower_omp_ordered): Ditto.
	(lower_omp_critical): Ditto.
	(lower_omp_for): Ditto.
	(lower_omp_taskreg): Ditto, tidy.
	(lower_omp_1): Adjust calls to lower_omp.
	(execute_lower_omp): Ditto.
	(lower_omp): Adjust to take pointer to sequence.
	(diagnose_sb_2): Use walk_gimple_seq_mod.
	(diagnose_omp_structured_block_errors): Ditto and set possibly
	changed function body.
	* gimple-low.c (lower_function_body): Set function body after
	it stabilizes.
	(lower_sequence): Adjust to take pointer to sequence.
	(lower_omp_directive): Ensure stmt isn't put twice into the
	sequence, adjust call to lower_sequence.
	(lower_stmt): Adjust calls to lower_sequence.
	(lower_gimple_bind): Ditto.
	(gimple_try_catch_may_fallthru): Call gsi_start with lvalue.
	* tree-nested.c (walk_body): Take pointer to sequence, use
	walk_gimple_seq_mod.
	(walk_function): Adjust call to walk_body, set possibly changed
	body.
	(walk_gimple_omp_for): Adjust calls to walk_body.
	(convert_nonlocal_omp_clauses): Ditto.
	(convert_nonlocal_reference_stmt): Ditto.
	(convert_local_omp_clauses): Ditto.
	(convert_local_reference_stmt): Ditto.
	(convert_tramp_reference_stmt): Ditto.
	(convert_gimple_call): Ditto.
	(convert_nl_goto_reference): Use local iterator copy.
	* gimple.c (walk_gimple_seq_mod): Renamed from walk_gimple_seq,
	but taking pointer to sequence, ensure gsi_start is called with
	callers lvalue.
	(walk_gimple_seq): New wrapper around walk_gimple_seq_mod,
	asserting that the sequence head didn't change.
	(walk_gimple_stmt): Replace all calls to walk_gimple_seq with
	walk_gimple_seq_mod.
	* trans-mem.c (lower_transaction): Use walk_gimple_seq_mod.
	(execute_lower_tm): Ditto, and set possibly changed body.
	* tree-eh.c (lower_eh_constructs_1): Take pointer to sequence,
	call gsi_start with that lvalue.
	(replace_goto_queue_stmt_list): Ditto.
	(replace_goto_queue_1): Adjust calls to replace_goto_queue_stmt_list.
	(replace_goto_queue): Ditto.
	(lower_try_finally_nofallthru): Adjust calls to lower_eh_constructs_1.
	(lower_try_finally_onedest): Ditto.
	(lower_try_finally_copy): Ditto.
	(lower_try_finally_switch): Ditto.
	(lower_try_finally): Ditto.
	(lower_eh_filter): Ditto.
	(lower_eh_must_not_throw): Ditto.
	(lower_cleanup): Ditto.
	(lower_eh_constructs_2): Ditto.
	(lower_catch): Ditto, and ensure gsi_start is called with lvalue.
	(lower_eh_constructs): Adjust calls to lower_eh_constructs_1, and
	set possibly changed body.
	(optimize_double_finally): Call gsi_start with lvalue.

	* tree-cfg.c (make_blocks): Adjust call to gsi_split_seq_before.
	(gimple_split_block): Ditto.
	(gimple_merge_blocks): Use gsi_start_phis.
	(move_stmt_r): Use walk_gimple_seq_mod.
	* tree-ssa-dse.c (dse_enter_block): Use gsi_last_bb.
	* cgraphbuild.c (build_cgraph_edges): Use gsi_start_phis.
	(rebuild_cgraph_edges): Ditto.
	(cgraph_rebuild_references): Ditto.
	* ipa-prop.c (ipa_analyze_params_uses): Ditto.
	* tree-inline.c (copy_phis_for_bb): Ditto.
	* tree-ssa-dce.c: Ditto.

	* cgraphunit.c (cgraph_analyze_function): Use gimple_has_body_p.

From-SVN: r187053
2012-05-02 16:41:48 +00:00
Jan Hubicka ead84f73b0 lto-symtab.c (lto_cgraph_replace_node): Merge needed instead of force flags.
* lto-symtab.c (lto_cgraph_replace_node): Merge needed instead of force flags.
	* cgraph.c (cgraph_add_thunk): Use mark_reachable_node.
	(cgraph_remove_node): Update.
	(cgraph_mark_needed_node): Remove.
	(cgraph_mark_force_output_node): New.
	(dump_cgraph_node): Do not dump needed flag.
	(cgraph_node_cannot_be_local_p_1): Update.
	(cgraph_can_remove_if_no_direct_calls_and_refs): Update.
	* cgraph.h (symtab_node_base): Add force_output flag.
	(cgraph_node): Remove needed flag.
	(varpool_node): Remove force_output flag.
	(cgraph_mark_needed_node): Remove.
	(cgraph_mark_force_output_node): New.
	(cgraph_only_called_directly_or_aliased_p,
	varpool_can_remove_if_no_refs, varpool_all_refs_explicit_p): Update.
	* ipa-cp.c (ipcp_generate_summary): Remove out of date assert.
	* cgraphunit.c (cgraph_decide_is_function_needed): rewrite.
	(cgraph_add_new_function); Update.
	(cgraph_mark_if_needed); Update.
	(verify_cgraph_node): Update.
	(cgraph_analyze_function): Alias target is reachable.
	(process_function_and_variable_attributes): Update: externally_visible
	flag makes function reachable.
	(cgraph_analyze_functions): Update dumping.
	* lto-cgraph.c (lto_output_node, lto_output_varpool_node,
	input_overwrite_node, input_varpool_node): Update streaming.
	* lto-streamer-out.c (produce_symtab): Use force_output.
	* ipa.c (process_references): Weakrefs must be processed.
	(cgraph_remove_unreachable_nodes): Likewise; update for new
	force_output flag.
	(varpool_externally_visible_p); Weakrefs are externally visible
	even if they are not.
	(function_and_variable_visibility): Update; when processing alias
	pair force the targets to be output.
	(whole_program_function_and_variable_visility): Use mark_reachable_node.
	* trans-mem.c (ipa_tm_mark_needed_node): Remove
	(ipa_tm_mark_force_output_node): New function.
	(ipa_tm_create_version_alias, ipa_tm_create_version): Update.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Be lax about aliases.
	* varasm.c (mark_decl_referenced): Update.
	(find_decl_and_mark_needed): Remove.
	(find_decl): New function.
	(weak_finish, finish_aliases_1, assemble_alias): Update; do not mark
	alias targets as needed.
	(dump_tm_clone_pairs): Update.
	* tree-inline.c (copy_bb): Update check.
	* symtab.c (dump_symtab_base): Dump force_output.
	* tree-ssa-structalias.c (ipa_pta_execute): Use force_output.
	* passes.c (execute_todo): Fix dumping.
	* varpool.c (decide_is_variable_needed, varpool_finalize_decl): Update.
	(varpool_analyze_pending_decls): Alias target is reachable.
	(varpool_create_variable_alias): Finalize weakrefs.

	* class.c (make_local_function_alias): Do not mark symbol referenced.

	* objc-acct.c (mark_referenced_methods); Use
	cgraph_mark_force_output_node.

	* gcc-interface/utils.c (gnat_write_global_declarations): Update for new
	force_output placement.

	* lto/lto-partition.c (partition_cgraph_node_p): Use force_output.

From-SVN: r186624
2012-04-20 14:09:11 +00:00
Martin Jambor 8e8483e6dc re PR middle-end/52939 (ice in gimple_get_virt_method_for_binfo with -O3)
2012-04-13  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/52939
	* gimple-fold.c (gimple_get_virt_method_for_binfo): Bail out if
	fold_ctor_reference returns a zero constant.

	* testsuite/g++.dg/ipa/pr52939.C: New test.

From-SVN: r186428
2012-04-13 19:57:21 +02:00
Mike Stump d25c4172fb * gimple-fold.c (gimple_fold_stmt_to_constant_1): Avoid warning.
From-SVN: r186202
2012-04-06 23:00:11 +00:00
Richard Guenther 6bcfb75385 tree-flow.h (struct pre_expr_d): Remove forward declaration.
2012-03-29  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (struct pre_expr_d): Remove forward declaration.
	(add_to_value): Remove.
	(print_value_expressions): Likewise.
	* tree-ssa-pre.c (add_to_value): Make static.
	(print_value_expressions): Likewise.
	* gimple.h (gimple_adjust_this_by_delta): Remove.
	* gimple-fold.c (gimple_adjust_this_by_delta): Likewise.

From-SVN: r185956
2012-03-29 12:47:51 +00:00
Richard Guenther d2a12ae77f tree.h (TREE_VECTOR_CST_ELTS): Remove.
2012-03-16  Richard Guenther  <rguenther@suse.de>

	* tree.h (TREE_VECTOR_CST_ELTS): Remove.
	(VECTOR_CST_NELTS, VECTOR_CST_ELTS, VECTOR_CST_ELT): New defines.
	(struct tree_vector): Remove elements member, add variable size
	elts array member.
	(build_vector_stat): Declare.
	(build_vector): Define in terms of build_vector_stat.
	* tree.c (build_vector): Rename to ...
	(build_vector_stat): ... this.  Take array of trees as parameter.
	(build_vector_from_ctor): Adjust.
	(integer_zerop, integer_onep, integer_all_onesp, iterative_hash_expr,
	initializer_zerop): Adjust.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* expr.c (categorize_ctor_elements_1, expand_expr_real_1,
	const_vector_from_tree): Likewise.
	* fold-const.c (const_binop, operand_equal_p, native_encode_vector,
	native_interpret_vector, fold_unary_loc, vec_cst_ctor_to_array,
	fold_vec_perm, fold_binary_loc, fold_ternary_loc): Likewise.
	* tree-streamer-in.c (streamer_alloc_tree): Handle TS_VECTOR.
	(lto_input_ts_vector_tree_pointers): Adjust.
	* tree-streamer-out.c (streamer_write_tree_header): Handle TS_VECTOR.
	(write_ts_vector_tree_pointers): Adjust.
	* varasm.c (const_hash_1, compare_constant, copy_constant,
	output_constant): Adjust.
	* gimple-fold.c (gimple_fold_stmt_to_constant_1): Adjust.
	* print-tree.c (print_node): Adjust.
	* tree-pretty-print.c (dump_generic_node): Adjust.
	* tree-vect-generic.c (uniform_vector_p, vector_element,
	lower_vec_perm): Adjust.
	* tree-vect-loop.c (get_initial_def_for_reduction): Adjust.
	* tree-vect-slp.c (vect_get_constant_vectors,
	vect_transform_slp_perm_load): Adjust.
	* tree-vect-stmts.c (vect_gen_perm_mask): Adjust.
	* expmed.c (make_tree): Adjust.

	* config/i386/i386.c (ix86_expand_builtin): Adjust.
	* config/sparc/sparc.c (sparc_handle_vis_mul8x16): Adjust interface
	and implementation.
	(sparc_fold_builtin): Adjust.

	c-family/
	* c-pretty-print.c (pp_c_initializer_list): Adjust.

From-SVN: r185458
2012-03-16 09:47:09 +00:00
Richard Guenther 7501ca28e3 re PR c++/52582 (g++ ICE when compiling qt-4.8.0 with -O2 on PPC (32bit))
2012-03-14  Richard Guenther  <rguenther@suse.de>

	PR middle-end/52582
	* gimple-fold.c (canonicalize_constructor_val): Make sure
	we have a cgraph node for a FUNCTION_DECL that comes from
	a constructor.
	(gimple_get_virt_method_for_binfo): Likewise.

From-SVN: r185381
2012-03-14 13:01:46 +00:00
Richard Guenther 3e888a5ed4 re PR middle-end/52329 (Invalid MEM_REF encountered in set_mem_attributes_minus_bitpos)
2012-02-22  Richard Guenther  <rguenther@suse.de>

	PR middle-end/52329
	* gimple-fold.c (fold_stmt_1): Also canonicalize ADDR_EXPRs
	for GIMPLE_DEBUG stmts.

From-SVN: r184466
2012-02-22 11:21:48 +00:00
Jakub Jelinek 949e47e576 re PR tree-optimization/52318 (ICE: in execute_todo, at passes.c:1748 with -O3 -ftracer -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce and stpcpy_chk())
PR tree-optimization/52318
	* gimple-fold.c (gimplify_and_update_call_from_tree): Add
	vdef also to non-pure/const call stmts in the sequence.

	* gcc.dg/pr52318.c: New test.

From-SVN: r184428
2012-02-21 10:24:42 +01:00
Romain Geissler f3fc9b804a builtins.def (BUILT_IN_STPNCPY_CHK): New definition.
* builtins.def (BUILT_IN_STPNCPY_CHK): New definition.
	* builtins.c (expand_builtin, fold_builtin_4, maybe_emit_chk_warning):
	Add BUILT_IN_STPNCPY_CHK case.
	* gimple-fold.c (gimple_fold_builtin): Likewise.
	* tree-object-size.c (pass_through_call): Likewise.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
	call_may_clobber_ref_p_1): Likewise.
	* tree-ssa-structalias.c (find_func_aliases_for_builtin_call,
	find_func_clobbers): Likewise.
	* tree.h (fold_builtin_strncpy_chk): Rename to fold_builtin_stxncpy_chk
	* builtins.c (fold_builtin_strncpy_chk): Likewise.
	Rewrite stpncpy_chk calls to strncpy_chk calls if returned value is
	ignored.

	* gcc.c-torture/execute/builtins/chk.h (stpncpy, stpncpy_disallowed):
	New definitions.
	* gcc.c-torture/execute/builtins/lib/chk.c (stpncpy_disallowed):
	Likewise.
	(stpncpy, __stpncpy_chk): New functions.
	* gcc.c-torture/execute/builtins/stpncpy-chk-lib.c: New file.
	* gcc.c-torture/execute/builtins/stpncpy-chk.c: Likewise.

From-SVN: r182378
2011-12-15 18:26:10 +01:00
Jakub Jelinek f6dbed3269 Revert
2011-12-12  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/51481
	* gimple-fold.c (gimple_fold_call): Call
	maybe_clean_or_replace_eh_stmt.  Avoid optimization if stmt has EH
	edges, but gimple_fold_builtin result can't throw.

From-SVN: r182284
2011-12-13 15:00:58 +01:00
Jakub Jelinek c88388e674 re PR tree-optimization/51481 (ice: dead STMT in EH table)
PR tree-optimization/51481
	* gimple-fold.c (gimple_fold_call): Call
	maybe_clean_or_replace_eh_stmt.  Avoid optimization if stmt has EH
	edges, but gimple_fold_builtin result can't throw.

	* gcc.dg/pr51481.c: New test.

From-SVN: r182264
2011-12-12 21:59:28 +01:00
Eric Botcazou 8f420307e0 gimple-fold.c (gimple_fold_stmt_to_constant_1): Also check the TYPE_MODE to recognize useless pointer conversions.
* gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>:
	Also check the TYPE_MODE to recognize useless pointer conversions.

From-SVN: r182178
2011-12-09 21:11:21 +00:00