aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-08gengtype.c (write_field_root): Avoid out-of-scope access of newv.Michael Matz1-22/+184
* 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-0/+42
From-SVN: r181154
2011-10-19re PR middle-end/50754 (ICE in expand_debug_expr, at cfgexpand.c:3341)Jakub Jelinek1-1/+4
PR middle-end/50754 * cfgexpand.c (expand_debug_expr): Handle WIDEN_LSHIFT_EXPR, ignore VEC_PERM_EXPR. From-SVN: r180201
2011-10-18md.texi (vec_widen_ushiftl_hi, [...]): Document.Ira Rosen1-0/+2
* doc/md.texi (vec_widen_ushiftl_hi, vec_widen_ushiftl_lo, vec_widen_sshiftl_hi, vec_widen_sshiftl_lo): Document. * tree-pretty-print.c (dump_generic_node): Handle WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (op_code_prio): Likewise. (op_symbol_code): Handle WIDEN_LSHIFT_EXPR. * optabs.c (optab_for_tree_code): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (init-optabs): Initialize optab codes for vec_widen_u/sshiftl_hi/lo. * optabs.h (enum optab_index): Add OTI_vec_widen_u/sshiftl_hi/lo. * genopinit.c (optabs): Initialize the new optabs. * expr.c (expand_expr_real_2): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. * gimple-pretty-print.c (dump_binary_rhs): Likewise. * tree-vectorizer.h (NUM_PATTERNS): Increase to 8. * tree.def (WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR, VEC_WIDEN_LSHIFT_LO_EXPR): New. * cfgexpand.c (expand_debug_expr): Handle new tree codes. * tree-vect-patterns.c (vect_vect_recog_func_ptrs): Add vect_recog_widen_shift_pattern. (vect_handle_widen_mult_by_const): Rename... (vect_handle_widen_op_by_const): ...to this. Handle shifts. Add a new argument, update documentation. (vect_recog_widen_mult_pattern): Assume that only second operand can be constant. Update call to vect_handle_widen_op_by_const. (vect_recog_over_widening_pattern): Fix typo. (vect_recog_widen_shift_pattern): New. * tree-vect-stmts.c (vectorizable_type_promotion): Handle widening shifts. (supportable_widening_operation): Likewise. * tree-inline.c (estimate_operator_cost): Handle new tree codes. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * config/arm/neon.md (neon_vec_<US>shiftl_<mode>): New. (vec_widen_<US>shiftl_lo_<mode>, neon_vec_<US>shiftl_hi_<mode>, vec_widen_<US>shiftl_hi_<mode>, neon_vec_<US>shift_left_<mode>): Likewise. * config/arm/predicates.md (const_neon_scalar_shift_amount_operand): New. * config/arm/iterators.md (V_innermode): New. * tree-vect-slp.c (vect_build_slp_tree): Require same shift operand for widening shift. From-SVN: r180128
2011-10-18tree-ssa-alias.h (struct pt_solution): Remove vars_contains_restrict member.Richard Guenther1-1/+1
2011-10-18 Richard Guenther <rguenther@suse.de> * tree-ssa-alias.h (struct pt_solution): Remove vars_contains_restrict member. (pt_solutions_same_restrict_base): Remove. (pt_solution_set): Adjust. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Remove vars_contains_restrict handling. (dump_points_to_solution): Likewise. (ptr_derefs_may_alias_p): Do not call pt_solutions_same_restrict_base. * tree-ssa-structalias.c (struct variable_info): Remove is_restrict_var field. (new_var_info): Do not initialize it. (ipa_escaped_pt): Adjust. (make_constraint_from_restrict): Make the tag global. (make_constraint_from_global_restrict): New function. (make_constraint_from_heapvar): Remove. (create_variable_info_for): Do not make restrict vars point to NONLOCAL. (intra_create_variable_infos): Likewise. (find_what_var_points_to): Remove vars_contains_restrict handling. (pt_solution_set): Adjust. (pt_solution_ior_into): Likewise. (pt_solutions_same_restrict_base): Remove. (compute_points_to_sets): Do not test is_restrict_var. * cfgexpand.c (update_alias_info_with_stack_vars): Adjust. * gimple-pretty-print.c (pp_points_to_solution): Likewise. * gcc.dg/torture/restrict-1.c: New testcase. From-SVN: r180127
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-09-03cfgexpand.c (add_stack_var): Assert that the alignment is not zero.Eric Botcazou1-0/+2
* cfgexpand.c (add_stack_var): Assert that the alignment is not zero. * tree-ssa-ccp.c (fold_builtin_alloca_for_var): Revert latest change. Force at least BITS_PER_UNIT alignment on the new variable. From-SVN: r178499
2011-08-23cfgexpand.c (expand_one_register_var): Use get_pointer_alignment.Michael Matz1-1/+26
* cfgexpand.c (expand_one_register_var): Use get_pointer_alignment. (gimple_expand_cfg): Merge alignment info for coalesced pointer SSA names. From-SVN: r177989
2011-07-15re PR debug/48220 (DW_OP_GNU_entry_value/DW_TAG_GNU_call_site_parameter vs ↵Eric Botcazou1-57/+63
register window) PR target/48220 * doc/md.texi (Standard Names): Document window_save. * cfgexpand.c (expand_debug_parm_decl): New function extracted from expand_debug_expr and expand_debug_source_expr. If the target has a window_save instruction, adjust the ENTRY_VALUE_EXP. (expand_debug_expr) <SSA_NAME>: Call expand_debug_parm_decl if the SSA_NAME_VAR is a parameter. (expand_debug_source_expr) <PARM_DECL>: Call expand_debug_parm_decl. * var-tracking.c (parm_reg_t): New type and associated vector type. (windowed_parm_regs): New variable. (adjust_insn): If the target has a window_save instruction and this is the instruction, make its effect on parameter registers explicit. (next_non_note_insn_var_location): New function. (emit_notes_in_bb): Use it instead of NEXT_INSN throughout. (vt_add_function_parameter): If the target has a window_save insn, adjust the incoming RTL and record that in windowed_parm_regs. (vt_finalize): Free windowed_parm_regs. From-SVN: r176318
2011-07-08optabs.c (expand_binop): Use GET_MODE_PRECISION instead of GET_MODE_BITSIZE ↵Bernd Schmidt1-2/+2
where appropriate. * optabs.c (expand_binop): Use GET_MODE_PRECISION instead of GET_MODE_BITSIZE where appropriate. (widen_leading, expand_parity, expand_ctz, expand_ffs, expand_unop, expand_abs_nojump, expand_one_cmpl_abs_nojump, expand_float, expand_fix): Likewise. * expr.c (convert_move, convert_modes, expand_expr_real_2, expand_expr_real_1, reduce_to_bit_field_precision): Likewise. * cfgexpand.c (convert_debug_memory_address, expand_debug_expr): Likewise. * convert.c (convert_to_integer): Likewise. * expmed.c (expand_shift_1): Likewise. From-SVN: r176038
2011-06-22re PR debug/47858 (IPA-SRA decreases quality of debug info)Jakub Jelinek1-1/+169
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-14dumping cleanup phase 1 -- Removing TODO_dump_funcDavid Li1-2/+1
From-SVN: r175051
2011-06-14re PR fortran/49103 (local variables exchange values / wrong code with -O3)Jakub Jelinek1-1/+5
PR fortran/49103 * tree.h (DECL_NONSHAREABLE): Define. (struct tree_decl_common): Change decl_common_unused to decl_nonshareable_flag. * cfgexpand.c (expand_used_vars_for_block, clear_tree_used): Ignore vars with DECL_NONSHAREABLE bit set. * tree-cfg.c (gimple_duplicate_bb): Set DECL_NONSHAREABLE on stores to automatic aggregate vars. * gfortran.dg/pr49103.f90: New test. From-SVN: r175028
2011-05-23cfgexpand.c (expand_debug_expr): For unused non-addressable parameters ↵Jakub Jelinek1-0/+14
passed in memory prefer using... * cfgexpand.c (expand_debug_expr): For unused non-addressable parameters passed in memory prefer using DECL_INCOMING_RTL over the pseudos it will be copied into. From-SVN: r174079
2011-04-21cfgexpand.c (stack_var): Remove OFFSET...Easwaran Raman1-57/+19
2011-04-21 Easwaran Raman <eraman@google.com> * gcc/cfgexpand.c (stack_var): Remove OFFSET... (add_stack_var): ...and its reference here... (expand_stack_vars): ...and here. (stack_var_cmp): Sort by descending order of size. (partition_stack_vars): Change heuristic. (union_stack_vars): Fix to reflect changes in partition_stack_vars. (dump_stack_var_partition): Add newline after each partition. testsuite/Changelog: 2011-04-21 Easwaran Raman <eraman@google.com> * gcc.dg/stack-layout-2.c: New test. From-SVN: r172837
2011-04-20cfgexpand.c (add_alias_set_conflicts): Add conflicts with a variable ↵Easwaran Raman1-2/+3
containing union type only with -fstrict-aliasing. 2011-04-20 Easwaran Raman <eraman@google.com> * cfgexpand.c (add_alias_set_conflicts): Add conflicts with a variable containing union type only with -fstrict-aliasing. 2011-04-20 Easwaran Raman <eraman@google.com> * gcc.dg/stack-layout-1.c: New test. From-SVN: r172788
2011-04-20Makefile.in (INTERNAL_FN_DEF, [...]): Define.Richard Sandiford1-1/+8
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-18re PR lto/48492 (LTO bootstrap failure in copy_constant)Eric Botcazou1-0/+1
PR lto/48492 * cfgexpand.c (expand_debug_expr) <VAR_DECL>: Return NULL for a DECL_IN_CONSTANT_POOL without RTL. From-SVN: r172641
2011-04-15cfgexpand.c (expand_debug_expr): Use simplify_gen_{unary,binary,ternary} ↵Jakub Jelinek1-123/+123
instead of gen_rtx_*. * cfgexpand.c (expand_debug_expr): Use simplify_gen_{unary,binary,ternary} instead of gen_rtx_*. From-SVN: r172518
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-15cfgexpand.c (expand_call_stmt): Convert the function type to the original ↵Eric Botcazou1-2/+2
one if this is not a builtin function. * cfgexpand.c (expand_call_stmt): Convert the function type to the original one if this is not a builtin function. From-SVN: r172471
2011-04-14cfgexpand.c (expand_call_stmt): Rematerialize the original function type if ↵Eric Botcazou1-4/+9
this is not a builtin function. * cfgexpand.c (expand_call_stmt): Rematerialize the original function type if this is not a builtin function. From-SVN: r172459
2011-04-14Update alignment on local variables.H.J. Lu1-4/+5
2011-04-14 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/48608 * cfgexpand.c (get_decl_align_unit): Renamed to ... (align_local_variable): This. Update DECL_ALIGN. (add_stack_var): Updated. (expand_one_stack_var): Likewise. From-SVN: r172438
2011-04-08re PR rtl-optimization/48389 (ICE: in make_edges, at cfgbuild.c:319 with ↵Michael Matz1-0/+3
-mtune=pentiumpro) PR middle-end/48389 * jump.c (rebuild_jump_labels_1, rebuild_jump_labels_chain): New functions. (rebuild_jump_labels): Call rebuild_jump_labels_1. * rtl.h (rebuild_jump_labels_chain): Declare. * cfgexpand.c (gimple_expand_cfg): Initialize JUMP_LABEL also on insns inserted on edges. testsuite/ * gcc.target/i386/pr48389.c: New test. From-SVN: r172208
2011-04-04re PR debug/48401 (ICE: RTL check: access of elt 4 of 'var_location' with ↵Jakub Jelinek1-3/+3
last elt 2 in expand_gimple_basic_block, at cfgexpand.c:3585) PR debug/48404 * cfgexpand.c (expand_gimple_basic_block): Avoid useless assignment. Use PAT_VAR_LOCATION_LOC instead of INSN_VAR_LOCATION_LOC. From-SVN: r171924
2011-03-31tree-ssa-forwprop.c (forward_propagate_into_cond): Avoid typo potentially ↵Jeff Law1-1/+1
leading to null pointer dereference. * tree-ssa-forwprop.c (forward_propagate_into_cond): Avoid typo potentially leading to null pointer dereference. * caller-save.c (new_saved_hard_reg): Eliminate return value. (setup_save_areas): Corresponding changes to avoid useless assignments. * jump.c (reversed_comparison_code_parts): Avoid successive return statements when REVERSE_CONDITION is defined. * expr.c (expand_assignment): Avoid useless assignments. (expand_expr_real_1): Likewise. (expand_expr_real_2): Avoid useless statements. * tree-ssa-phiopt.c (minmax_replacement): Avoid useless statement. * cfgexpand.c (expand_gimple_basic_block): Avoid useless assignment. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Avoid useless statements. * stmt.c (expand_expr_stmt): Avoid useless assignment. From-SVN: r171780
2011-03-29re PR debug/48203 (ICE in dwarf2out.c while building eglibc.)Jakub Jelinek1-2/+4
PR debug/48203 * cfgexpand.c (expand_debug_expr) <case SSA_NAME>: Only create ENTRY_VALUE if incoming or address of incoming's MEM is a hard REG. * dwarf2out.c (mem_loc_descriptor): Don't emit DW_OP_GNU_entry_value of DW_OP_fbreg. * var-tracking.c (vt_add_function_parameter): Ensure cselib_lookup on ENTRY_VALUE is able to find the canonical parameter VALUE. * cselib.c (rtx_equal_for_cselib_1) <case ENTRY_VALUE>: Use rtx_equal_p instead of rtx_equal_for_cselib_1 to compare ENTRY_VALUE_EXPs. (cselib_hash_rtx) <case ENTRY_VALUE>: If ENTRY_VALUE_EXP is a REG_P or MEM_P with REG_P address, compute hash directly instead of calling cselib_hash_rtx on ENTRY_VALUE_EXP. (preserve_only_constants): Don't clear VALUES forwaring ENTRY_VALUE to some other VALUE. * gcc.dg/pr48203.c: New test. From-SVN: r171640
2011-03-28cfgexpand.c (expand_gimple_cond): Always set the source location and block ↵Eric Botcazou1-24/+14
before expanding the statement. * cfgexpand.c (expand_gimple_cond): Always set the source location and block before expanding the statement. (expand_gimple_stmt_1): Likewise. Set them here... (expand_gimple_stmt): ...and not here. Tidy. * cfglayout.c (curr_insn_locator): Return 0 if the current location is unknown. From-SVN: r171629
2011-03-16re PR debug/45882 (No debug info for vars depending on unused parameter)Jakub Jelinek1-1/+25
PR debug/45882 * rtl.def (ENTRY_VALUE): Change format from "e" to "0". * rtl.h (ENTRY_VALUE_EXP): Define. * rtl.c (rtx_equal_p_cb, rtx_equal_p): Handle ENTRY_VALUE. * cselib.c (rtx_equal_for_cselib_p, cselib_hash_rtx): Likewise. * print-rtl.c (print_rtx): Likewise. * gengtype.c (adjust_field_rtx_def): Likewise. * var-tracking.c (vt_add_function_parameter): Adjust gen_rtx_ENTRY_VALUE uses, use ENTRY_VALUE_EXP macro. * dwarf2out.c (mem_loc_descriptor): Use ENTRY_VALUE_EXP macro. * cfgexpand.c (expand_debug_expr): If a SSA_NAME without partition is a default definition of a PARM_DECL, use ENTRY_VALUE of its DECL_INCOMING_RTL if possible, or its DECL_RTL if set. * gcc.dg/guality/pr45882.c: New test. From-SVN: r171035
2011-03-03re PR debug/47283 (ICE in refs_may_alias_p_1, at tree-ssa-alias.c)Jakub Jelinek1-0/+12
PR debug/47283 * cfgexpand.c (expand_debug_expr) <case MEM_REF>: If MEM_REF first operand is not is_gimple_mem_ref_addr, try to fold it. If the operand still isn't is_gimple_mem_ref_addr, clear MEM_EXPR on op0. From-SVN: r170654
2011-02-28re PR debug/47283 (ICE in refs_may_alias_p_1, at tree-ssa-alias.c)Jakub Jelinek1-7/+66
PR debug/47283 * cfgexpand.c (convert_debug_memory_address): Add AS parameter. Use target address_mode and pointer_mode hooks instead of hardcoded Pmode and ptr_mode. Handle some simple cases of extending if POINTERS_EXTEND_UNSIGNED < 0. (expand_debug_expr) <case MEM_REF, INDIRECT_REF, TARGET_MEM_REF>: Call convert_debug_memory_address. (expand_debug_expr) <case ADDR_EXPR>: Pass as to convert_debug_memory_address. From-SVN: r170566
2011-02-18re PR debug/47780 (-fcompare-debug failure with -O -fgcse -fgcse-las ↵Jakub Jelinek1-1/+1
-fstack-protector-all) PR debug/47780 * cfgexpand.c (expand_debug_expr) <case SSA_NAME>: Call copy_rtx to avoid invalid rtx sharing. * gcc.target/i386/pr47780.c: New test. From-SVN: r170270
2011-02-17re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-37/+7
-flto -fconserve-stack) PR debug/47106 PR debug/47402 * cfgexpand.c (account_used_vars_for_block): Remove. (estimated_stack_frame_size): Use referenced vars. * tree-inline.c (remap_decl): Only mark VAR_DECLs as referenced that were referenced in the original function. Test src_fn rather than cfun. Drop redundant get_var_ann. (setup_one_parameter): Drop redundant get_var_ann. (declare_return_variable): Likewise. (copy_decl_for_dup_finish): Mark VAR_DECLs referenced in src_fn. (copy_arguments_for_versioning): Drop redundant get_var_ann. * ipa-inline.c (compute_inline_parameters): Do not compute disregard_inline_limits here. are not available. (compute_inlinable_for_current, pass_inlinable): New. (pass_inline_parameters): Require PROP_referenced_vars. * cgraphunit.c (cgraph_process_new_functions): Don't run compute_inline_parameters explicitly unless function is in SSA form. (cgraph_analyze_function): Set .disregard_inline_limits. * tree-sra.c (convert_callers): Compute inliner parameters only for functions already in SSA form. * g++.dg/debug/pr47106.C: New. Co-Authored-By: Jan Hubicka <jh@suse.cz> From-SVN: r170249
2011-02-15re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-10/+11
-flto -fconserve-stack) PR debug/47106 PR debug/47402 * tree-inline.h (estimated_stack_frame_size): Take cgraph node rather than decl. * cfgexpand.c (estimated_stack_frame_size): Likewise. * ipa-inline.c (compute_inline_parameters): Adjust. From-SVN: r170187
2011-02-15re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-1/+1
-flto -fconserve-stack) PR debug/47106 PR debug/47402 * tree-flow.h (referenced_var_lookup): Add fn parameter. Adjust all callers. * tree-dfa.c (referenced_var_lookup): Use fn instead of cfun. * tree-flow-inline.h: Adjust. * gimple-pretty-print.c: Adjust. * tree-into-ssa.c: Adjust. * tree-ssa.c: Adjust. * cfgexpand.c: Adjust. From-SVN: r170185
2011-02-02re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-1/+1
-flto -fconserve-stack) PR debug/47106 PR debug/47402 * tree-flow-inline.h (clear_is_used, is_used_p): New. * cfgexpand.c (account_used_vars_for_block): Use them. * tree-nrv.c (tree_nrv): Likewise. * tree-ssa-live.c (remove_unused_scope_block_p): Likewise. (dump_scope_block): Likewise. (remove_unused_locals): Likewise. From-SVN: r169515
2011-01-21re PR debug/47106 (-fcompare-debug failure (length) with -fpartial-inlining ↵Alexandre Oliva1-2/+3
-flto -fconserve-stack) PR debug/47106 * cfgexpand.c (account_used_vars_for_block): Only account vars that are annotated as used. (estimated_stack_frame_size): Don't set TREE_USED. * tree-dfa.c (create_var_ann): Mark variable as used. From-SVN: r169093
2011-01-20re PR debug/47283 (ICE in refs_may_alias_p_1, at tree-ssa-alias.c)Jakub Jelinek1-0/+8
PR debug/47283 * cfgexpand.c (expand_debug_expr): Instead of generating (mem (debug_implicit_ptr)) for MEM_REFs use COMPONENT_REF etc. handling. * g++.dg/debug/pr47283.C: New test. From-SVN: r169057
2011-01-02Bump Copyright years.Jakub Jelinek1-1/+1
From-SVN: r168403
2011-01-02re PR rtl-optimization/47028 (gcc.dg/tree-ssa/tailrecursion-[57].c FAIL with ↵Jakub Jelinek1-1/+13
-foptimize-sibling-calls -fno-forward-propagate -fno-tree-copy-prop -fno-tree-dominator-opts) PR rtl-optimization/47028 * cfgexpand.c (gimple_expand_cfg): Insert entry edge insertions after parm_birth_insn instead of at the beginning of first bb. * gcc.dg/pr47028.c: New test. From-SVN: r168401
2010-12-16re PR debug/46893 (ICE: in trunc_int_for_mode, at explow.c:56 with -O -g)Jakub Jelinek1-2/+3
PR debug/46893 * cfgexpand.c (expand_debug_expr): If GET_MODE (op0) is VOIDmode, use TYPE_MODE (TREE_TYPE (tem)) instead of mode1. * gcc.dg/pr46893.c: New test. From-SVN: r167949
2010-12-14re PR middle-end/46667 (-freorder-blocks-and-partition -g failed and ↵Jan Hubicka1-0/+4
libstdc++ builds for arm-eabi are broken.) PR middle-end/46667 * varasm.c (assemble_start_function): Do not call resolve_unique_section. * cfgexpand.c (gimple_expand_cfg): Resolve it here. From-SVN: r167795
2010-12-07re PR debug/46799 (-fcompare-debug failure (length) with ↵Jakub Jelinek1-0/+2
-ftree-parallelize-loops=2 -fno-tree-dce) PR debug/46799 * tree-parloops.c (separate_decls_in_region): Use UNKNOWN_LOCATION instead of BUILTINS_LOCATION. (create_loop_fn): Add LOC argument, pass it to build_decl instead of BUILTINS_LOCATION. (create_parallel_loop): Add LOC argument, use it for OMP clauses and GIMPLE_*OMP* statements. (gen_parallel_loop): Determine locus for the parallel loop, pass it to create_loop_fn and create_parallel_loop. * cfgexpand.c (gimple_expand_cfg): For builtin functions, call set_curr_insn_source_location (UNKNOWN_LOCATION). * gcc.dg/autopar/pr46799.c: New test. From-SVN: r167533
2010-11-24re PR middle-end/46629 (Failed to build 200.sixtrack in SPEC CPU 2000)Jakub Jelinek1-1/+1
PR middle-end/46629 * cfgexpand.c (maybe_cleanup_end_of_block): Test NEXT_INSN (insn) instead of insn with any_condjump_p. From-SVN: r167108
2010-11-23re PR middle-end/46499 (gcc.c-torture/execute/20051021-1.c FAILs with ↵Jakub Jelinek1-1/+8
-fno-tree-dominator-opts -fno-tree-ccp) PR middle-end/46499 * cfgexpand.c (maybe_cleanup_end_of_block): Remove also BARRIERs following unconditional jumps. * gcc.dg/pr46499-1.c: New test. * gcc.dg/pr46499-2.c: New test. From-SVN: r167082
2010-11-09re PR target/43808 (-fipa-reference -fschedule-insns -fstrict-aliasing ↵Jakub Jelinek1-4/+5
causes two gfortran check failures) PR target/43808 * cfgexpand.c (partition_stack_vars): Call update_alias_info_with_stack_vars unconditionally. (update_alias_info_with_stack_vars): Allow unused unreferenced vars when not optimizing. * gfortran.dg/pr43808.f90: New test. From-SVN: r166509
2010-11-05cfgexpand.c (expand_debug_expr): Handle MEM_REF with non-zero offset.Jakub Jelinek1-4/+9
* cfgexpand.c (expand_debug_expr): Handle MEM_REF with non-zero offset. From-SVN: r166353
2010-11-05re PR debug/46307 (ICE with FMA_EXPR in DEBUG stmts)Jakub Jelinek1-0/+4
PR debug/46307 * tree-ssa-operands.c (get_expr_operands): Handle FMA_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_code_prio): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * gcc.dg/pr46307.c: New test. From-SVN: r166351
2010-11-03builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert.Nathan Froyd1-1/+1
gcc/ * builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert. * c-typeck.c (build_function_call_vec): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * cgraphunit.c (assemble_thunk): Likewise. * config/sparc/sparc.c (sparc_fold_builtin): Likewise. * fold-const.c (fold_unary_loc, fold_mult_zconjz): Likewise. (fold_binary_loc, fold_ternary_loc): Likewise. * gimple-fold.c (get_symbol_constant_value): Likewise. * gimple-low.c (lower_builtin_setjmp): Likewise. * gimple.c (gimple_cond_get_ops_from_tree): Likewise. * gimplify.c (gimplify_init_constructor): Likewise. * lambda.h (build_linear_expr): Likewise. * omp-low.c (omp_reduction_init): Likewise. * tree-inline.c (remap_ssa_name): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-sra.c (init_subtree_with_zero): Likewise. (sra_ipa_modify_assign): Likewise. * tree-ssa-copy.c (propagate_tree_value_into_stmt): Likewise. * tree-ssa-reassoc.c (eliminate_duplicate_pair): Likewise. (eliminate_plus_minus_pair, eliminate_not_pairs): Likewise. (undistribute_ops_list): Likewise. * tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise. * tree-vect-stmts.c (vectorizable_call): Likewise. * tree.c (build_vector_from_ctor, build_one_cst): Likewise. (build_zero_cst): Handle more cases directly. Update comment. gcc/cp/ * class.c (build_base_path, add_vcall_offset): Use build_zero_cst instead of fold_convert. * init.c (build_zero_init): Likewise. * typeck.c (cp_build_binary_op): Likewise. gcc/fortran/ * trans-decl.c (add_argument_checking): Use build_zero_cst instead of fold_convert. * trans-expr.c (gfc_conv_missing_dummy, fill_with_spaces): Likewise. * trans-stmt.c (gfc_trans_do): Likewise. From-SVN: r166227
2010-10-12re PR middle-end/45962 (many c/c++ failures on cris-elf, in r165236:165242)Richard Henderson1-7/+16
PR middle-end/45962 * cfgexpand.c (add_stack_var): Ensure every variable has 1 byte. (expand_stack_vars): Assert large base allocated when used. From-SVN: r165382