Commit Graph

158 Commits

Author SHA1 Message Date
Martin Jambor
39cc8c3d6b re PR tree-optimization/50605 (ice in ipa_get_jf_pass_through_result with -O3)
2011-11-18  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/50605
	* gimple.c (is_gimple_ip_invariant_address): Also handle MEM_REFs
	of IPA invariant decls.

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

From-SVN: r181477
2011-11-18 16:13:54 +01:00
Richard Guenther
723afc4436 re PR middle-end/51071 (ICE in gimple_has_side_effects, at gimple.c:2513)
2011-11-10  Richard Guenther  <rguenther@suse.de>

	PR middle-end/51071
	* gimple.c (gimple_has_side_effects): Remove checking code
	that doesn't belong here.

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

From-SVN: r181253
2011-11-10 12:22:46 +00:00
Michael Matz
47598145be gengtype.c (write_field_root): Avoid out-of-scope access of newv.
* gengtype.c (write_field_root): Avoid out-of-scope access of newv.

	* tree-stdarg.c (execute_optimize_stdarg): Accept clobbers.

	* tree.h (TREE_CLOBBER_P): New macro.
	* gimple.h (gimple_clobber_p): New inline function.
	* gimplify.c (gimplify_bind_expr): Add clobbers for all variables
	that go out of scope and live in memory.
	* tree-ssa-operands.c (get_expr_operands): Transfer volatility also
	for constructors.
	* cfgexpand.c (decl_to_stack_part): New static variable.
	(add_stack_var): Allocate it, and remember mapping.
	(fini_vars_expansion): Deallocate it.
	(stack_var_conflict_p): Add early outs.
	(visit_op, visit_conflict, add_scope_conflicts_1,
	add_scope_conflicts): New static functions.
	(expand_used_vars_for_block): Don't call add_stack_var_conflict, tidy.
	(expand_used_vars): Add scope conflicts.
	(expand_gimple_stmt_1): Expand clobbers to nothing.
	(expand_debug_expr): Ditto.

	* tree-pretty-print.c (dump_generic_node): Dump clobbers nicely.
	* tree-ssa-live.c (remove_unused_locals): Remove clobbers that
	refer to otherwise unused locals.
	* tree-sra.c (build_accesses_from_assign): Ignore clobbers.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Clobbers of
	SSA names aren't necessary.
	(propagate_necessity): Accept and ignore constructors on the rhs,
	tidy.
	* gimple.c (walk_gimple_op): Accept constructors like mem_rhs.
	* tree-ssa-structalias.c (find_func_aliases): Clobbers don't store
	any known value.
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Ditto, in particular they
	don't zero-initialize something.
	* tree-ssa-phiopt.c (cond_if_else_store_replacement_1): Ignore
	clobber RHS, we don't want PHI nodes with those.

testsuite/
	* gcc.dg/tree-ssa/20031015-1.c: Adjust.
	* g++.dg/tree-ssa/ehcleanup-1.C: Ditto.
	* g++.dg/eh/builtin1.C: Rewrite to not use local variables.
	* g++.dg/eh/builtin2.C: Ditto.
	* g++.dg/eh/builtin3.C: Ditto.

From-SVN: r181172
2011-11-08 16:47:16 +00:00
Aldy Hernandez
0a35513e4e Merge from transactional-memory branch.
From-SVN: r181154
2011-11-08 11:13:41 +00:00
Jakub Jelinek
9dd58aa41c gimple.c (walk_stmt_load_store_addr_ops): Call visit_addr also on COND_EXPR/VEC_COND_EXPR comparison operands if...
* gimple.c (walk_stmt_load_store_addr_ops): Call visit_addr
	also on COND_EXPR/VEC_COND_EXPR comparison operands if they are
	ADDR_EXPRs.

From-SVN: r179969
2011-10-14 14:05:43 +02:00
Richard Henderson
2205ed2513 Rename vshuffle/vec_shuffle to vec_perm.
* doc/extend.texi (__builtin_shuffle): Improve the description to
        include the modulus of the selector.  Mention OpenCL.
        * doc/md.texi (vec_perm, vec_perm_const): Document named patterns.

        * tree.def (VEC_PERM_EXPR): Rename from VEC_SHUFFLE_EXPR.
        * genopinit.c (optabs): Rename vshuffle to vec_perm.
        * c-typeck.c (c_build_vec_perm_expr): Rename from
        c_build_vec_shuffle_expr.  Update for name changes.
        * optabs.c (expand_vec_perm_expr_p): Rename from
        expand_vec_shuffle_expr_p.
        (expand_vec_perm_expr): Rename from expand_vec_shuffle_expr.
        * optabs.h (OTI_vec_perm): Rename from DOI_vshuffle.
        (vec_perm_optab): Rename from vshuffle_optab.
        * expr.c, gimple-pretty-print.c, gimple.c, gimplify.c,
        c-tree.h, c-parser.c, tree-cfg.c, tree-inline.c, tree-pretty-print.c,
        tree-ssa-operands.c, tree-vect-generic.c: Update for name changes.

        * config/i386/i386.c (ix86_expand_vec_perm): Rename from
        ix86_expand_vshuffle.
        * config/i386/i386-protos.h: Update.
        * config/i386/sse.md (VEC_PERM_AVX2): Rename from VSHUFFLE_AVX2.
        (vec_perm<VEC_PERM_AVX2>): Rename from vshuffle<VSHUFFLE_AVX2>.

From-SVN: r179701
2011-10-07 15:41:48 -07:00
Tom de Vries
13e49da934 re PR middle-end/50527 (inconsistent vla align)
2011-10-07  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/50527
	* tree.c (build_common_builtin_nodes): Add local_define_builtin for
	BUILT_IN_ALLOCA_WITH_ALIGN.  Mark that BUILT_IN_ALLOCA_WITH_ALIGN can
	throw.
	* builtins.c (expand_builtin_alloca): Handle BUILT_IN_ALLOCA_WITH_ALIGN
	arglist.  Set align for	BUILT_IN_ALLOCA_WITH_ALIGN.
	(expand_builtin): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	(is_inexpensive_builtin): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	* tree-ssa-ccp.c (evaluate_stmt): Set align for
	BUILT_IN_ALLOCA_WITH_ALIGN.
	(fold_builtin_alloca_for_var): Rename to ...
	(fold_builtin_alloca_with_align): Set DECL_ALIGN from 2nd
	BUILT_IN_ALLOCA_WITH_ALIGN argument.
	(ccp_fold_stmt): Try folding BUILT_IN_ALLOCA_WITH_ALIGN using
	fold_builtin_alloca_with_align.
	(optimize_stack_restore): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	* builtins.def (BUILT_IN_ALLOCA_WITH_ALIGN): Declare using
	DEF_BUILTIN_STUB.
	* ipa-pure-const.c (special_builtin_state): Handle
	BUILT_IN_ALLOCA_WITH_ALIGN.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1)
	(call_may_clobber_ref_p_1): Same.
	* function.c (gimplify_parameters): Lower vla to
	BUILT_IN_ALLOCA_WITH_ALIGN.
	* gimplify.c (gimplify_vla_decl): Same.
	* cfgexpand.c (expand_call_stmt): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	* tree-mudflap.c (mf_xform_statements): Same.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary)
	(mark_all_reaching_defs_necessary_1, propagate_necessity): Same.
	* varasm.c (incorporeal_function_p): Same.
	* tree-object-size.c (alloc_object_size): Same.
	* gimple.c (gimple_build_call_from_tree): Same.

From-SVN: r179655
2011-10-07 12:49:49 +00:00
Artjoms Sinkarovs
f90e8e2eae Vector shuffling patch from Artem Shinkarov.
From-SVN: r179462
2011-10-03 08:13:26 -07:00
Jakub Jelinek
2186081438 gimple-fold.c (gimplify_and_update_call_from_tree): Set gctx.into_ssa after push_gimplify_context.
* gimple-fold.c (gimplify_and_update_call_from_tree): Set
	gctx.into_ssa after push_gimplify_context.

	* gimple.c (gimple_build_call_valist): New function.
	* gimple.h (gimple_build_call_valist): New prototype.
	* tree-ssa-propagate.c (finish_update_gimple_call): New function.
	(update_gimple_call): Likewise.
	(update_call_from_tree): Use finish_update_gimple_call.
	* tree-ssa-propagate.h (update_gimple_call): New prototype.

From-SVN: r179204
2011-09-26 18:19:55 +02:00
Richard Guenther
4e71066d7e expr.c (expand_expr_real_2): Move COND_EXPR and VEC_COND_EXPR handling here, from ...
2011-08-31  Richard Guenther  <rguenther@suse.de>

	* expr.c (expand_expr_real_2): Move COND_EXPR and VEC_COND_EXPR
	handling here, from ...
	(expand_expr_real_1): ... here.
	* gimple-pretty-print.c (dump_ternary_rhs): Handle COND_EXPR
	and VEC_COND_EXPR.
	* gimple.c (gimple_rhs_class_table): Make COND_EXPR and VEC_COND_EXPR
	a GIMPLE_TERNARY_RHS.
	* tree-cfg.c (verify_gimple_assign_ternary): Handle COND_EXPR
	and VEC_COND_EXPR here ...
	(verify_gimple_assign_single): ... not here.
	* gimple-fold.c (fold_gimple_assign): Move COND_EXPR folding.
	* tree-object-size.c (cond_expr_object_size): Adjust.
	(collect_object_sizes_for): Likewise.
	* tree-scalar-evolution.c (interpret_expr): Don't handle
	ternary RHSs.
	* tree-ssa-forwprop.c (forward_propagate_into_cond): Fix and
	simplify.
	(ssa_forward_propagate_and_combine): Adjust.
	* tree-ssa-loop-im.c (move_computations_stmt): Build the COND_EXPR
	as ternary.
	* tree-ssa-threadedge.c (fold_assignment_stmt): Adjust.
	* tree-vect-loop.c (vect_is_simple_reduction_1): Likewise.
	* tree-vect-stmt.c (vectorizable_condition): Likewise.
	* tree-vrp.c (extract_range_from_cond_expr): Likewise.
	(extract_range_from_assignment): Likewise.

From-SVN: r178408
2011-09-01 11:46:08 +00:00
Jakub Jelinek
cb3d2e3327 re PR tree-optimization/49948 (ICE with -ftree-parallelize-loops: "address taken, but ADDRESSABLE bit not set")
PR tree-optimization/49948
	* gimple.c (walk_stmt_load_store_addr_ops): Walk CONSTRUCTOR elements.

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

From-SVN: r177291
2011-08-03 20:49:40 +02:00
Kai Tietz
9b80d091af gimple.c (canonicalize_cond_expr_cond): Handle cast from boolean-type.
* gimple.c (canonicalize_cond_expr_cond): Handle cast from
	boolean-type.
	(ssa_forward_propagate_and_combine): Interprete result of
	forward_propagate_comparison.
	* gcc/gimple-fold.c (fold_gimple_assign): Add canonicalization for
	boolean-typed operands for comparisons.

	* gcc.dg/tree-ssa/forwprop-15.c: New testcase.

From-SVN: r177170
2011-08-02 16:55:47 +02:00
Jakub Jelinek
ddb555ed51 re PR debug/47858 (IPA-SRA decreases quality of debug info)
PR debug/47858
	* gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND.
	(gimple_build_debug_source_bind_stat): New prototype.
	(gimple_build_debug_source_bind): Define.
	(gimple_debug_source_bind_p, gimple_debug_source_bind_get_var,
	gimple_debug_source_bind_get_value,
	gimple_debug_source_bind_get_value_ptr,
	gimple_debug_source_bind_set_var,
	gimple_debug_source_bind_set_value): New inlines.
	* gimple.c (gimple_build_debug_source_bind_stat): New function.
	* gimple-pretty-print.c (dump_gimple_debug): Handle
	GIMPLE_DEBUG_SOURCE_BIND.
	* sese.c (rename_uses): Handle gimple_debug_source_bind_p.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
	* tree-parloops.c (eliminate_local_variables,
	separate_decls_in_region): Likewise.
	(separate_decls_in_region_debug): Renamed from
	separate_decls_in_region_debug_bind.  Handle
	gimple_debug_source_bind_p.
	* tree.h (decl_debug_args_lookup, decl_debug_args_insert): New
	prototypes.
	(DECL_HAS_DEBUG_ARGS_P): Define.
	(struct tree_function_decl): Add has_debug_args_flag field.
	* tree.c (debug_args_for_decl): New variable.
	(decl_debug_args_lookup, decl_debug_args_insert): New functions.
	* tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts.
	(rewrite_debug_stmt_uses): New function.
	(rewrite_stmt): Use it to rewrite debug stmt uses.
	* rtl.def (DEBUG_PARAMETER_REF): New.
	* rtl.h (DEBUG_PARAMETER_REF_DECL): Define.
	* cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle
	DEBUG_PARAMETER_REF.
	* rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of
	SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind
	debug stmts in the first bb.
	* tree-inline.c (remap_ssa_name): If remapping default def
	of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in
	a source bind debug stmt.
	(remap_gimple_stmt): Handle gimple_debug_source_bind_p.
	(maybe_move_debug_stmts_to_successors): Likewise.
	(copy_debug_stmt): Likewise.  Avoid shadowing a variable.
	(tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy
	debug args vector from old_decl to new_decl.
	* ipa-prop.c (ipa_modify_call_arguments): For optimized away
	or modified parameters, add debug bind stmts before call
	setting DEBUG_EXPR_DECL which is remembered in debug args
	vector.
	* cfgexpand.c (expand_call_stmt): Call expand_debug_expr
	on DECL_DEBUG_EXPRs from debug args vector.
	(expand_debug_source_expr): New function.
	(expand_debug_locations): Use it for source bind insns.
	(expand_gimple_basic_block): Handle gimple_debug_source_bind_p.
	* var-tracking.c (prepare_call_arguments): Add debug args
	to call_arguments if any.
	* dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr,
	output_loc_operands, output_loc_operands_raw,
	resolve_addr_in_expr, compare_loc_operands): Handle
	DW_OP_GNU_parameter_ref.
	(get_ref_die_offset, parameter_ref_descriptor): New functions.
	(mem_loc_descriptor): Handle DEBUG_PARAMETER_REF.
	(gen_subprogram_die): Handle parameters identified by
	DEBUG_PARAMETER_REF.

	* dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref.

From-SVN: r175288
2011-06-22 12:41:58 +02:00
Richard Guenther
1243089639 gimple.c (canonicalize_cond_expr_cond): (bool)x is not the same as x != 0.
2011-06-16  Richard Guenther  <rguenther@suse.de>

	* gimple.c (canonicalize_cond_expr_cond): (bool)x is not
	the same as x != 0.
	* fold-const.c (fold_binary_loc): Do not fold X & 1 != 0 to
	(bool) X & 1.
	* ipa-prop.c (ipa_analyze_indirect_call_uses): Also allow
	equality compares against zero for the lower bit.

From-SVN: r175096
2011-06-16 08:41:50 +00:00
Richard Guenther
2611db71ea gimple.c (gimple_register_canonical_type): Do not register any types via gimple_register_type.
2011-05-31  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_register_canonical_type): Do not register
	any types via gimple_register_type.

From-SVN: r174483
2011-05-31 14:24:22 +00:00
Richard Guenther
17e99cdb2d gimple.c (gimple_types_compatible_p_1): Compare record and union type members properly.
2011-05-30  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_types_compatible_p_1): Compare record
	and union type members properly.

From-SVN: r174436
2011-05-30 14:55:03 +00:00
Richard Guenther
e7cfe2413f gimple.c (iterative_hash_canonical_type): Skip non-FIELD_DECLs.
2011-05-25  Richard Guenther  <rguenther@suse.de>

	* gimple.c (iterative_hash_canonical_type): Skip non-FIELD_DECLs.
	(gimple_canonical_types_compatible_p): Likewise.

From-SVN: r174181
2011-05-25 10:32:29 +00:00
Richard Guenther
6a20ce76e5 gimple.c (compare_type_names_p): Remove for_completion_p arg.
2011-05-24  Richard Guenther  <rguenther@suse.de>

	* gimple.c (compare_type_names_p): Remove for_completion_p arg.
	(gimple_compatible_complete_and_incomplete_subtype_p): Remove.
	(gimple_types_compatible_p_1): Adjust.
	(iterative_hash_canonical_type): Do not bother about complete vs.
	incomplete types.
	(gimple_canonical_types_compatible_p): Likewise.

From-SVN: r174118
2011-05-24 14:33:48 +00:00
Richard Guenther
96d91dcf6a re PR bootstrap/49078 (LTO bootstrap failed with bootstrap-profiled)
2011-05-24  Richard Guenther  <rguenther@suse.de>

	PR bootstrap/49078
	* gimple.c (gimple_register_canonical_type): Revert
	previous change.
	* alias.c (get_alias_set): Only assert that TYPE_CANONICAL
	does not for a tree for the case where it matters.  Cache
	pointer-type alias-sets.

From-SVN: r174113
2011-05-24 12:40:28 +00:00
Richard Guenther
e1caba18c8 gimple.c (gimple_types_compatible_p_1): Always compare type names.
2011-05-23  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_types_compatible_p_1): Always compare type names.
	(iterative_hash_gimple_type): Always hash type names.

From-SVN: r174074
2011-05-23 15:36:32 +00:00
Richard Guenther
0ea80a1603 re PR middle-end/48849 (SPEC CPU 2000/2006 failed to build with LTO)
2011-05-20  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48849
	* gimple.c (gimple_register_canonical_type): Compute TYPE_CANONICAL
	of pointer types the same way the middle-end does.

From-SVN: r173939
2011-05-20 09:35:44 +00:00
Richard Guenther
fb291a1ea7 gimple.c (gimple_register_type_1): Do not fiddle with main-variant or pointer-to chains.
2011-05-20  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_register_type_1): Do not fiddle with
	main-variant or pointer-to chains.  Delay all fixup to
	uniquify_nodes.

	lto/
	* lto.c (lto_ft_common): Remove pointer-to chain teardown.
	(lto_ft_type): Move main-variant and pointer-to chain building ...
	(uniquify_nodes): ... here.  Compute TYPE_CANONICAL also here,
	in a separate final loop.

From-SVN: r173938
2011-05-20 09:35:03 +00:00
Jan Hubicka
a30726a434 gimple.c (gtc_visited, [...]): Remove.
* gimple.c (gtc_visited, gtc_ob, type_pair_hash, type_pair_eq): Remove.
	(GIMPLE_TYPE_PAIR_SIZE): New macro.
	(type_pair_cache): New static var.
	(lookup_type_pair): Use fixed sized custom hash; make inline.
	(gtc_visit, gimple_types_compatible_p, gimple_register_type_1): Update
	calls of lookup_type_pair.
	(print_gimple_types_stats): Remove cache stats.
	(free_gimple_type_tables): Free type_pair_cache instead of gtc_visited
	and gtc_ob.

From-SVN: r173925
2011-05-19 21:49:10 +00:00
Richard Guenther
31b3ca64f4 gimple.c (gimple_types_compatible_p_1): Compare names of the types themselves.
2011-05-19  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_types_compatible_p_1): Compare names of
	the types themselves.
	(iterative_hash_gimple_type): And hash them that way.
	(gimple_register_type_1): If we register a main variant properly
	initialize the leader to ourselves.

	lto/
	* lto.c (uniquify_nodes): First register all types before
	fixing up the tree SCC.

From-SVN: r173900
2011-05-19 10:31:23 +00:00
Richard Guenther
179184e3e5 re PR tree-optimization/49018 (Inline assembly block executed outside conditional check with "-O1 -ftree-vrp")
2011-05-18  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/49018
	* gimple.c (gimple_has_side_effects): Volatile asms have side-effects.
	* tree-ssa-ifcombine.c (bb_no_side_effects_p): Use
	gimple_has_side_effects.

From-SVN: r173861
2011-05-18 13:33:21 +00:00
Richard Guenther
93b2a207a6 gimple.c (gimple_register_type_1): New function, split out from ...
2011-05-18  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_register_type_1): New function, split out from ...
	(gimple_register_type): ... here.  Avoid infinite recursion.

From-SVN: r173857
2011-05-18 11:34:43 +00:00
Richard Guenther
5beaf6643b gimple.c (type_hash_pair_compare): Fix comparison.
2011-05-17  Richard Guenther  <rguenther@suse.de>

	* gimple.c (type_hash_pair_compare): Fix comparison.

From-SVN: r173832
2011-05-17 14:58:18 +00:00
Richard Guenther
008bad7a3e gimple.c (iterative_hash_gimple_type): Simplify singleton case some more, fix final hash value of the non-singleton case.
2011-05-17  Richard Guenther  <rguenther@suse.de>

	* gimple.c (iterative_hash_gimple_type): Simplify singleton
	case some more, fix final hash value of the non-singleton case.

From-SVN: r173829
2011-05-17 12:39:50 +00:00
Richard Guenther
3646134083 re PR bootstrap/49013 (LTO bootstrap failed with bootstrap-profiled)
2011-05-17  Richard Guenther  <rguenther@suse.de>

        PR bootstrap/49013
        Revert
        2011-05-16  Richard Guenther  <rguenther@suse.de>

        * gimple.c (gimple_types_compatible_p_1): Use names of the
        type itself, not its main variant.
        (iterative_hash_gimple_type): Likewise.

From-SVN: r173827
2011-05-17 10:29:36 +00:00
Richard Guenther
6b6a59f36c gimple.c (gimple_register_canonical_type): Use the main-variant leader for computing the canonical type.
2011-05-17  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_register_canonical_type): Use the main-variant
	leader for computing the canonical type.

From-SVN: r173826
2011-05-17 10:04:23 +00:00
Richard Guenther
c11b690223 gimple.c (gimple_types_compatible_p_1): Use names of the type itself, not its main variant.
2011-05-16  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_types_compatible_p_1): Use names of the
	type itself, not its main variant.
	(iterative_hash_gimple_type): Likewise.

From-SVN: r173795
2011-05-16 16:07:35 +00:00
Richard Guenther
1e83b5f197 gimple.c (iterative_hash_gimple_type): Re-instantiate change to always visit pointer target and function result and...
2011-05-16  Richard Guenther  <rguenther@suse.de>

	* gimple.c (iterative_hash_gimple_type): Re-instantiate
	change to always visit pointer target and function result
	and argument types.

From-SVN: r173794
2011-05-16 15:10:05 +00:00
Richard Guenther
3066f593a8 gimple.c (struct type_hash_pair): New type.
2011-05-16  Richard Guenther  <rguenther@suse.de>

	* gimple.c (struct type_hash_pair): New type.
	(type_hash_pair_compare): New function.
	(iterative_hash_gimple_type): Mix in SCC member hashes in
	hash-order.

From-SVN: r173790
2011-05-16 13:52:56 +00:00
Richard Guenther
b8a71aedd8 gimple.c (gimple_canonical_types_compatible_p): Do not use type-pair caching, do not compare hashes.
2011-05-13  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_canonical_types_compatible_p): Do not use
	type-pair caching, do not compare hashes.

From-SVN: r173734
2011-05-13 14:02:42 +00:00
Richard Guenther
e834e95c36 re PR lto/48978 (excessive hash table allocation for large lto build)
2011-05-13  Richard Guenther  <rguenther@suse.de>

	PR lto/48978
	* gimple.c (iterative_hash_gimple_type): Revert change in
	pointer target and function result and argument hashing.

From-SVN: r173730
2011-05-13 11:02:28 +00:00
Richard Guenther
61332f7774 gimple.c (gtc_visit): Compare TREE_ADDRESSABLE, handle NULLPTR_TYPE similar to VOID_TYPE.
2011-05-12  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gtc_visit): Compare TREE_ADDRESSABLE, handle
	NULLPTR_TYPE similar to VOID_TYPE.  Defer type-leader lookup
	until after simple checks.
	(gimple_types_compatible_p): Likewise.
	(iterative_hash_gimple_type): Always hash pointer targets
	and function return and argument types.
	(iterative_hash_canonical_type): Do not hash TYPE_QUALS,
	hash TYPE_ALIGN.  Do not hash TYPE_MIN/MAX_VALUE.
	(gimple_canonical_types_compatible_p): Compare TREE_ADDRESSABLE,
	handle NULLPTR_TYPE similar to VOID_TYPE.  Handle non-aggregates
	completely in the simple compare section.
	(gimple_register_canonical_type): Query the cache again after
	registering.

From-SVN: r173704
2011-05-12 14:04:29 +00:00
Richard Guenther
d034095964 re PR bootstrap/48964 (LTO profiledbootstrap failure)
2011-05-11  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48964
	* gimple.c (iterative_hash_canonical_type): Fix typo.

From-SVN: r173663
2011-05-11 15:44:59 +00:00
Richard Guenther
b5e04de5e3 gimple.c (gimple_type_hash_1): Merge with ...
2011-05-11  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_type_hash_1): Merge with ...
	(gimple_type_hash): ... this.
	(gtc_visit): Remove mode parameter and simplify accordingly.
	(gimple_types_compatible_p_1): Likewise.
	(gimple_types_compatible_p): Likewise.
	(iterative_hash_gimple_type): Likewise.
	(visit): Likewise.
	(gimple_type_eq): Adjust.

From-SVN: r173655
2011-05-11 12:45:00 +00:00
Richard Guenther
825b27deb9 gimple.c (gimple_canonical_types_compatible_p): Split out from gimple_types_compatible_p and friends.
2011-05-11  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_canonical_types_compatible_p): Split out
	from gimple_types_compatible_p and friends.  Do not recurse
	to pointed-to types.
	(gimple_canonical_type_eq): Use it.
	(iterative_hash_canonical_type): Split out from
	iterative_hash_gimple_type and friends.  Do not recurse
	to pointed-to types.
	(gimple_canonical_type_hash): Use it, allocate the hash here.

From-SVN: r173649
2011-05-11 08:36:51 +00:00
Richard Guenther
0ca8de87c4 lto-symtab.c (lto_cgraph_replace_node): Use types_compatible_p for diagnostics.
2011-05-09  Richard Guenther  <rguenther@suse.de>

	* lto-symtab.c (lto_cgraph_replace_node): Use types_compatible_p
	for diagnostics.
	(lto_symtab_merge): Likewise.  Do not register types here.
	(lto_symtab_merge_decls_2): Likewise.
	(lto_symtab_merge_decls_1): Likewise.
	* gimple.h (enum gtc_mode, gimple_types_compatible_p): Do not declare.
	* gimple.c (enum gtc_mode): Declare.
	(gimple_types_compatible_p): Make static.

From-SVN: r173575
2011-05-09 16:00:48 +00:00
Jan Hubicka
4fc07af967 gimple.c (type_pair_hash, [...]): Arrange type pairs to be UID ordered.
* gimple.c (type_pair_hash, type_pair_eq, lookup_type_pair):
	Arrange type pairs to be UID ordered.
	(gimple_lookup_type_leader): Make inline.

From-SVN: r173560
2011-05-09 08:45:16 +00:00
Eric Botcazou
4d931f416b * gimple.c (walk_gimple_op) <GIMPLE_CALL>: Fix couple of oversights.
From-SVN: r172828
2011-04-21 14:15:51 +00:00
Richard Sandiford
25583c4f45 Makefile.in (INTERNAL_FN_DEF, [...]): Define.
gcc/
	* Makefile.in (INTERNAL_FN_DEF, INTERNAL_FN_H): Define.
	(GIMPLE_H): Include $(INTERNAL_FN_H).
	(OBJS-common): Add internal-fn.o.
	(internal-fn.o): New rule.
	* internal-fn.def: New file.
	* internal-fn.h: Likewise.
	* internal-fn.c: Likewise.
	* gimple.h: Include internal-fn.h.
	(GF_CALL_INTERNAL): New gf_mask.
	(gimple_statement_call): Put fntype into a union with a new
	internal_fn field.
	(gimple_build_call_internal): Declare.
	(gimple_build_call_internal_vec): Likewise.
	(gimple_call_same_target_p): Likewise.
	(gimple_call_internal_p): New function.
	(gimple_call_internal_fn): Likewise.
	(gimple_call_fntype): Return null for internal calls.
	(gimple_call_set_fntype): Assert that the function is not internal.
	(gimple_call_set_fn): Likewise.
	(gimple_call_set_fndecl): Likewise.
	(gimple_call_set_internal_fn): New function.
	(gimple_call_addr_fndecl): Handle null functions.
	(gimple_call_return_type): Likewise null types.
	* gimple.c (gimple_build_call_internal_1): New function.
	(gimple_build_call_internal): Likewise.
	(gimple_build_call_internal_vec): Likewise.
	(gimple_call_same_target_p): Likewise.
	(gimple_call_flags): Handle calls to internal functions.
	(gimple_call_fnspec): New function.
	(gimple_call_arg_flags, gimple_call_return_flags): Use it.
	(gimple_has_side_effects): Handle null functions.
	(gimple_rhs_has_side_effects): Likewise.
	(gimple_call_copy_skip_args): Handle calls to internal functions.
	* cfgexpand.c (expand_call_stmt): Likewise.
	* expr.c (expand_expr_real_1): Assert that the call isn't internal.
	* gimple-fold.c (gimple_fold_call): Handle null functions.
	(gimple_fold_stmt_to_constant_1): Don't fold
	calls to internal functions.
	* gimple-low.c (gimple_check_call_args): Handle calls to internal
	functions.
	* gimple-pretty-print.c (dump_gimple_call): Likewise.
	* ipa-prop.c (ipa_analyze_call_uses): Handle null functions.
	* tree-cfg.c (verify_gimple_call): Handle calls to internal functions.
	(do_warn_unused_result): Likewise.
	* tree-eh.c (same_handler_p): Use gimple_call_same_target_p.
	* tree-ssa-ccp.c (ccp_fold_stmt): Handle calls to internal functions.
	* tree-ssa-dom.c (hashable_expr): Use the gimple statement to record
	the target of a call.
	(initialize_hash_element): Update accordingly.
	(hashable_expr_equal_p): Use gimple_call_same_target_p.
	(iterative_hash_hashable_expr): Handle calls to internal functions.
	(print_expr_hash_elt): Likewise.
	* tree-ssa-pre.c (can_value_number_call): Likewise.
	(eliminate): Handle null functions.
	* tree-ssa-sccvn.c (visit_use): Handle calls to internal functions.
	* tree-ssa-structalias.c (get_fi_for_callee): Likewise.
	(find_func_aliases): Likewise.
	* value-prof.c (gimple_ic_transform): Likewise.
	(gimple_indirect_call_to_profile): Likewise.
	* lto-streamer-in.c (input_gimple_stmt): Likewise.
	* lto-streamer-out.c (output_gimple_stmt): Likewise.

From-SVN: r172758
2011-04-20 08:21:25 +00:00
Eric Botcazou
abe36b81c5 re PR bootstrap/48148 (LTO bootstrap failed with bootstrap-profiled)
PR lto/48148
	* gimple.c (gimple_types_compatible_p_1) <ENUMERAL_TYPE>: Do not merge
	the types if they have different enumeration identifiers.

From-SVN: r172712
2011-04-19 14:46:37 +00:00
Michael Matz
63d2a3533f tree.h (ALLOCA_FOR_VAR_P): Rename to CALL_ALLOCA_FOR_VAR_P.
* tree.h (ALLOCA_FOR_VAR_P): Rename to CALL_ALLOCA_FOR_VAR_P.
	* builtins.c (expand_builtin): Use CALL_ALLOCA_FOR_VAR_P.
	* function.c (gimplify_parameters): Ditto.
	* gimplify.c (gimplify_vla_decl): Ditto.

	* gimple.h (enum gf_mask): Add GF_CALL_ALLOCA_FOR_VAR.
	(gimple_call_set_alloca_for_var): New inline function.
	(gimple_call_alloca_for_var_p): Ditto.
	* gimple.c (gimple_build_call_from_tree): Remember CALL_ALLOCA_FOR_VAR_P
	state.
	* cfgexpand.c (expand_call_stmt): Restore CALL_ALLOCA_FOR_VAR_P state.

	* tree-inline.c (inline_forbidden_p_stmt): Don't reject alloca
	calls if they were for VLA objects.

From-SVN: r172516
2011-04-15 19:48:25 +00:00
Nathan Froyd
edcdea5b00 gimple.h (gimple_asm_clobbers_memory_p): Declare.
* gimple.h (gimple_asm_clobbers_memory_p): Declare.
	* gimple.c (gimple_asm_clobbers_memory_p): Define.
	* ipa-pure-const.c (check_stmt): Call it.
	* tree-ssa-operands.c (get_asm_expr_operands): Likewise.

From-SVN: r172496
2011-04-15 14:27:55 +00:00
Richard Guenther
f20ca72587 re PR tree-optimization/46076 (constant propagation and compile-time math no longer happening versus 4.4 and 4.5)
2011-04-12  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46076
	* gimple.h (struct gimple_statement_call): Add fntype field.
	(gimple_call_fntype): Adjust.
	(gimple_call_set_fntype): New function.
	* gimple.c (gimple_build_call_1): Set the call function type.
	* gimplify.c (gimplify_call_expr): Preserve the function
	type the frontend used for the call.
	(gimplify_modify_expr): Likewise.
	* lto-streamer-in.c (input_gimple_stmt): Input the call stmts
	function type.
	* lto-streamer-out.c (output_gimple_stmt): Output the call stmts
	function type.
	* tree-ssa.c (useless_type_conversion_p): Function pointer
	conversions are useless.

	* gcc.dg/tree-ssa/pr46076.c: Un-XFAIL.

From-SVN: r172310
2011-04-12 10:44:15 +00:00
Mike Stump
dd5a833e6e Remove doubled up words.
From-SVN: r172247
2011-04-10 18:46:45 +00:00
Richard Guenther
97e03fa170 gimple.c (gimple_call_flags): Remove kludge.
2011-04-08  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_call_flags): Remove kludge.

From-SVN: r172190
2011-04-08 14:36:14 +00:00
Richard Guenther
0f8c63cc10 gimple.c (gimple_set_modified): Do not queue calls to MODIFIED_NORETURN_CALLS here ...
2011-04-08  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_set_modified): Do not queue calls to
	MODIFIED_NORETURN_CALLS here ...
	* tree-ssa-operands.c (update_stmt_operands): ... but here.

From-SVN: r172182
2011-04-08 13:22:32 +00:00