aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-10re PR middle-end/51071 (ICE in gimple_has_side_effects, at gimple.c:2513)Richard Guenther1-38/+4
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-08gengtype.c (write_field_root): Avoid out-of-scope access of newv.Michael Matz1-1/+3
* 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-08Merge from transactional-memory branch.Aldy Hernandez1-56/+81
From-SVN: r181154
2011-10-14gimple.c (walk_stmt_load_store_addr_ops): Call visit_addr also on ↵Jakub Jelinek1-3/+18
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-07Rename vshuffle/vec_shuffle to vec_perm.Richard Henderson1-1/+1
* 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-07re PR middle-end/50527 (inconsistent vla align)Tom de Vries1-1/+2
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-03Vector shuffling patch from Artem Shinkarov.Artjoms Sinkarovs1-0/+1
From-SVN: r179462
2011-09-26gimple-fold.c (gimplify_and_update_call_from_tree): Set gctx.into_ssa after ↵Jakub Jelinek1-3/+24
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-01expr.c (expand_expr_real_2): Move COND_EXPR and VEC_COND_EXPR handling here, ↵Richard Guenther1-5/+5
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-08-03re PR tree-optimization/49948 (ICE with -ftree-parallelize-loops: "address ↵Jakub Jelinek1-0/+14
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-02gimple.c (canonicalize_cond_expr_cond): Handle cast from boolean-type.Kai Tietz1-1/+3
* 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-06-22re PR debug/47858 (IPA-SRA decreases quality of debug info)Jakub Jelinek1-1/+25
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-16gimple.c (canonicalize_cond_expr_cond): (bool)x is not the same as x != 0.Richard Guenther1-9/+1
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-05-31gimple.c (gimple_register_canonical_type): Do not register any types via ↵Richard Guenther1-12/+0
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-30gimple.c (gimple_types_compatible_p_1): Compare record and union type ↵Richard Guenther1-3/+9
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-25gimple.c (iterative_hash_canonical_type): Skip non-FIELD_DECLs.Richard Guenther1-4/+12
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-24gimple.c (compare_type_names_p): Remove for_completion_p arg.Richard Guenther1-66/+11
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-24re PR bootstrap/49078 (LTO bootstrap failed with bootstrap-profiled)Richard Guenther1-20/+6
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-23gimple.c (gimple_types_compatible_p_1): Always compare type names.Richard Guenther1-7/+6
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-20re PR middle-end/48849 (SPEC CPU 2000/2006 failed to build with LTO)Richard Guenther1-0/+19
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-20gimple.c (gimple_register_type_1): Do not fiddle with main-variant or ↵Richard Guenther1-76/+7
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-19gimple.c (gtc_visited, [...]): Remove.Jan Hubicka1-68/+31
* 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-19gimple.c (gimple_types_compatible_p_1): Compare names of the types themselves.Richard Guenther1-5/+9
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-18re PR tree-optimization/49018 (Inline assembly block executed outside ↵Richard Guenther1-7/+14
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-18gimple.c (gimple_register_type_1): New function, split out from ...Richard Guenther1-17/+32
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-17gimple.c (type_hash_pair_compare): Fix comparison.Richard Guenther1-3/+5
2011-05-17 Richard Guenther <rguenther@suse.de> * gimple.c (type_hash_pair_compare): Fix comparison. From-SVN: r173832
2011-05-17gimple.c (iterative_hash_gimple_type): Simplify singleton case some more, ↵Richard Guenther1-4/+7
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-17re PR bootstrap/49013 (LTO bootstrap failed with bootstrap-profiled)Richard Guenther1-2/+3
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-17gimple.c (gimple_register_canonical_type): Use the main-variant leader for ↵Richard Guenther1-9/+4
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-16gimple.c (gimple_types_compatible_p_1): Use names of the type itself, not ↵Richard Guenther1-3/+2
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-16gimple.c (iterative_hash_gimple_type): Re-instantiate change to always visit ↵Richard Guenther1-34/+8
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-16gimple.c (struct type_hash_pair): New type.Richard Guenther1-7/+77
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-13gimple.c (gimple_canonical_types_compatible_p): Do not use type-pair ↵Richard Guenther1-47/+17
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-13re PR lto/48978 (excessive hash table allocation for large lto build)Richard Guenther1-8/+34
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-12gimple.c (gtc_visit): Compare TREE_ADDRESSABLE, handle NULLPTR_TYPE similar ↵Richard Guenther1-237/+112
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-11re PR bootstrap/48964 (LTO profiledbootstrap failure)Richard Guenther1-1/+1
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-11gimple.c (gimple_type_hash_1): Merge with ...Richard Guenther1-119/+64
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-11gimple.c (gimple_canonical_types_compatible_p): Split out from ↵Richard Guenther1-3/+497
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-09lto-symtab.c (lto_cgraph_replace_node): Use types_compatible_p for diagnostics.Richard Guenther1-1/+3
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-09gimple.c (type_pair_hash, [...]): Arrange type pairs to be UID ordered.Jan Hubicka1-9/+15
* 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-04-21* gimple.c (walk_gimple_op) <GIMPLE_CALL>: Fix couple of oversights.Eric Botcazou1-2/+4
From-SVN: r172828
2011-04-20Makefile.in (INTERNAL_FN_DEF, [...]): Define.Richard Sandiford1-20/+103
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-19re PR bootstrap/48148 (LTO bootstrap failed with bootstrap-profiled)Eric Botcazou1-0/+3
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-15tree.h (ALLOCA_FOR_VAR_P): Rename to CALL_ALLOCA_FOR_VAR_P.Michael Matz1-1/+6
* 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-15gimple.h (gimple_asm_clobbers_memory_p): Declare.Nathan Froyd1-0/+17
* 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-12re PR tree-optimization/46076 (constant propagation and compile-time math no ↵Richard Guenther1-0/+1
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-10Remove doubled up words.Mike Stump1-1/+1
From-SVN: r172247
2011-04-08gimple.c (gimple_call_flags): Remove kludge.Richard Guenther1-10/+1
2011-04-08 Richard Guenther <rguenther@suse.de> * gimple.c (gimple_call_flags): Remove kludge. From-SVN: r172190
2011-04-08gimple.c (gimple_set_modified): Do not queue calls to ↵Richard Guenther1-9/+1
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-08gimple.h (gimple_call_fntype): New function.Richard Guenther1-6/+8
2011-04-08 Richard Guenther <rguenther@suse.de> * gimple.h (gimple_call_fntype): New function. (gimple_call_return_type): Use it. * expr.c (expand_expr_real_1): Use gimple_call_fntype. * gimple-low.c (gimple_check_call_args): Likewise. * gimple.c (gimple_call_flags): Likewise. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. * tree-cfg.c (verify_gimple_call): Likewise. (do_warn_unused_result): Likewise. * tree-ssa-ccp.c (ccp_fold_stmt): Likewise. * value-prof.c (gimple_ic_transform): Fix fndecl check. From-SVN: r172178