aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
AgeCommit message (Collapse)AuthorFilesLines
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
2010-10-09re PR rtl-optimization/33721 ([meta-bug] Gcc can't properly align stack ↵Richard Henderson1-80/+187
variable) PR rtl-opt/33721 * explow.c (allocate_dynamic_stack_space): Add REQUIRED_ALIGN parm, remove TARGET parm, convert KNOWN_ALIGN parm to SIZE_ALIGN. Honor required_align, tidy the code a bit. Emit split_stack code in the right place. Mark the return value with the alignment properly. * expr.h (allocate_dynamic_stack_space): Update decl. * builtins.c (expand_builtin_apply): Update call to allocate_dynamic_stack_space. (expand_builtin_alloca): Likewise. Remove TARGET parameter. * calls.c (initialize_argument_information): Update call to allocate_dynamic_stack_space. (expand_call): Likewise. * cfgexpand.c (get_decl_align_unit): Don't limit alignment. Don't update_stack_alignment here. (alloc_stack_frame_space): Make ALIGN unsigned. (stack_var_cmp): Sort by alignment too. (partition_stack_vars): Don't merge large and small alignment vars. (expand_one_stack_var_at): Add BASE and BASE_ALIGN parameters. Take care when BASE is not virtual_stack_vars_rtx. (expand_stack_vars): Allocate dynamic stack space for large alignment variables. (expand_one_stack_var): Update all to expand_one_stack_var_at. (defer_stack_allocation): True for large alignment vars. (update_stack_alignment): Merge into ... (expand_one_var): ... here. (gimple_expand_cfg): Place code from expand_stack_vars. From-SVN: r165240
2010-09-20re PR rtl-optimization/45678 (crash on vector code with -m32 -msse)Jakub Jelinek1-3/+1
PR middle-end/45678 * cfgexpand.c (expand_one_stack_var_at): Use crtl->max_used_stack_slot_alignment as max_align, instead of maximum of that and PREFERRED_STACK_BOUNDARY. Don't call update_stack_alignment. From-SVN: r164454
2010-09-17Update stack alignment when increasing local variable alignment.H.J. Lu1-11/+20
gcc/ 2010-09-17 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/45678 * cfgexpand.c (update_stack_alignment): New. (get_decl_align_unit): Use it. (expand_one_stack_var_at): Call update_stack_alignment. gcc/testsuite/ 2010-09-17 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/45678 * gcc.dg/torture/pr45678-2.c: New. From-SVN: r164375
2010-09-09rtl.def (DEBUG_IMPLICIT_PTR): New rtl code.Jakub Jelinek1-1/+26
* rtl.def (DEBUG_IMPLICIT_PTR): New rtl code. * rtl.h (DEBUG_IMPLICIT_PTR_DECL): Define. * rtl.c (rtx_equal_p_cb, rtx_equal_p): Handle DEBUG_IMPLICIT_PTR. * print-rtl.c (print_rtx): Likewise. * cselib.c (rtx_equal_for_cselib_p, cselib_hash_rtx): Likewise. * cfgexpand.c (expand_debug_expr): Generate DEBUG_IMPLICIT_PTR for ADDR_EXPR with non-addressable object. * dwarf2out.c (enum dw_val_class): Add dw_val_class_decl_ref. (struct dw_val_struct): Add v.val_decl_ref. (dwarf_stack_op_name, output_loc_operands, output_loc_operands_raw): Handle DW_OP_GNU_implicit_pointer. (size_of_loc_descr): Likewise. Fix up DW_OP_call_ref size. (get_ref_die_offset_label): New function. (implicit_ptr_descriptor): New function. (mem_loc_descriptor): Handle DEBUG_IMPLICIT_PTR. (loc_descriptor): Likewise. (gen_variable_die): Put even definitions into decl_die_table. (resolve_addr_in_expr): Resolve still unresolved DW_OP_GNU_implicit_pointer operands, if it can't be resolved return false. (dwarf2out_finish): Call output_location_lists after outputting .debug_info and .debug_abbrev instead of before. * dwarf2.h (DW_OP_GNU_implicit_pointer): New. 2010-09-09 Roland McGrath <roland@redhat.com> * dwarf2out.c (DWARF_REF_SIZE): Define. (size_of_loc_descr): Use it for DW_OP_call_ref. From-SVN: r164050
2010-09-06tree.def (MISALIGNED_INDIRECT_REF): Remove.Richard Guenther1-1/+0
2010-09-06 Richard Guenther <rguenther@suse.de> * tree.def (MISALIGNED_INDIRECT_REF): Remove. * tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF. (build_aligned_type): Declare. * tree.c (check_qualified_type): Also compare TYPE_ALIGN. (check_aligned_type): New function. (build_aligned_type): Likewise. * expr.c (expand_assignment): Handle misaligned stores via TARGET_MEM_REF and MEM_REF using movmisalign_optab. (expand_expr_real_1): Likewise. (safe_from_p): Remove MISALIGNED_INDIRECT_REF handling. * tree-vect-stmts.c (vectorizable_store): Do not build MISALIGNED_INDIRECT_REF but initialize alignment information. (vectorizable_load): Likewise. * builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF handling. * cfgexpand.c (expand_debug_expr): Likewise. * dwarf2out.c (loc_list_from_tree): Likewise. * fold-const.c (maybe_lvalue_p): Likewise. (operand_equal_p): Likewise. (build_fold_addr_expr_with_type_loc): Likewise. * gimplify.c (gimplify_addr_expr): Likewise. (gimplify_expr): Likewise. * tree-cfg.c (verify_types_in_gimple_min_lval): Likewise. (verify_gimple_assign_single): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. (tree_could_trap_p): Likewise. * tree-predcom.c (ref_at_iteration): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. (op_code_prio): Likewise. (op_symbol_code): Likewise. * tree-ssa-ccp.c (get_value_from_alignment): Likewise. * tree-ssa-loop-im.c (for_each_index): Likewise. (gen_lsm_tmp_name): Likewise. * tree-ssa-loop-ivopts.c (idx_find_step): Likewise. (find_interesting_uses_address): Likewise. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise. (ao_ref_init_from_vn_reference): Likewise. * tree.c (staticp): Likewise. (build1_stat): Likewise. (reference_alias_ptr_type): Likewise. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * config/rs6000/rs6000.c (rs6000_check_sdmode): Remove MISALIGNED_INDIRECT_REF handling. From-SVN: r163915
2010-09-03tree.def (TARGET_MEM_REF): Merge TMR_SYMBOL and TMR_BASE.Richard Guenther1-2/+2
2010-09-03 Richard Guenther <rguenther@suse.de> * tree.def (TARGET_MEM_REF): Merge TMR_SYMBOL and TMR_BASE. Move TMR_OFFSET to second operand. Add TMR_INDEX2. * tree.h (TMR_SYMBOL): Remove. (TMR_BASE, TMR_OFFSET): Adjust. (TMR_INDEX2): New. * alias.c (ao_ref_from_mem): Use TMR_BASE. * builtins.c (get_object_alignment): Merge TMR_BASE and TMR_SYMBOL handling. * cfgexpand.c (expand_debug_expr): Use TMR_BASE. * gimple.c (get_base_address): Merge MEM_REF and TARGET_MEM_REF handling. Also allow TARGET_MEM_REF as base address. (walk_stmt_load_store_addr_ops): TMR_BASE is always non-NULL. * gimplify.c (gimplify_expr): Gimplify TMR_BASE like MEM_REF base. Gimplify TMR_INDEX2. * tree-cfg.c (verify_types_in_gimple_reference): Adjust. * tree-dfa.c (get_ref_base_and_extent): Likewise. (get_addr_base_and_unit_offset): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): Simplify. Handle TMR_INDEX2. (create_mem_ref_raw): Merge symbol and base. Move 2ndary base to index2. (get_address_description): Reconstruct addres description from merged TMR_BASE and TMR_INDEX2. (maybe_fold_tmr): Fold propagated addresses. * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Merge MEM_REF and TARGET_MEM_REF paths. (indirect_refs_may_alias_p): Likewise. * tree-ssa-live.c (mark_all_vars_used_1): Handle TMR_INDEX2 instead of TMR_SYMBOL. * tree-ssa-operands.c (get_tmr_operands): Simplify. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Adjust according to changes ... * tree-ssa-sccvn.c (copy_reference_ops_from_ref): ... here. Split TARGET_MEM_REF into two fields plus the base. * tree.c (mem_ref_offset): Simplify. * tree-ssa-loop-im.c (for_each_index): Handle TMR_INDEX2. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. Strip NOPs when folding MEM_REF addresses. * tree-ssa-sink.c (is_hidden_global_store): Handle TARGET_MEM_REF. * gimple-fold.c (maybe_fold_reference): Fold TARGET_MEM_REF here ... (fold_gimple_assign): ... not here. From-SVN: r163802
2010-09-01alias.c (ao_ref_from_mem): Adjust.Richard Guenther1-1/+2
2010-09-01 Richard Guenther <rguenther@suse.de> * alias.c (ao_ref_from_mem): Adjust. * builtins.c (get_object_alignment): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * gimple.c (get_base_address): Likewise. * tree-dfa.c (get_ref_base_and_extent): Likewise. (get_addr_base_and_unit_offset): Likewise. Fix for both TMR_SYMBOL and TMR_BASE being set. * tree-eh.c (tree_could_trap_p): Likewise. * gimplify.c (gimplify_expr): Do not attempt to gimplify TMR_SYMBOL. Always gimplify TMR_BASE. * tree-cfg.c (verify_types_in_gimple_reference): Verify TMR_BASE if there is a TMR_SYMBOL. * tree-pretty-print.c (dump_generic_node): Adjust. * tree-ssa-address.c (addr_for_mem_ref): Likewise. (tree_mem_ref_addr): Likewise. (create_mem_ref_raw): Likewise. (move_fixed_address_to_symbol): Likewise. (create_mem_ref): Likewise. (dump_mem_address): Likewise. * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Adjust. Fix for both TMR_SYMBOL and TMR_BASE being set. (indirect_refs_may_alias_p): Likewise. * tree-ssa-operands.c (get_tmr_operands): Adjust. * tree.def (TARGET_MEM_REF): Adjust documentation. From-SVN: r163733
2010-07-27re PR target/44542 (expand_one_stack_var_at may set DECL_ALIGN to a too high ↵Jakub Jelinek1-5/+12
value) PR target/44542 * cfgexpand.c (expand_one_stack_var_at): Limit align to maximum of max_used_stack_slot_alignment and PREFERRED_STACK_BOUNDARY instead of MAX_SUPPORTED_STACK_ALIGNMENT. (expand_one_var): Don't consider DECL_ALIGN for variables for which expand_one_stack_var_at has been already called. From-SVN: r162582
2010-07-20re PR debug/45006 (Failed to bootstrap)Jakub Jelinek1-1/+3
PR debug/45006 * cfgexpand.c (expand_debug_expr): Only look at TYPE_UNSIGNED of operand's type if exp is tcc_unary class tree. From-SVN: r162348
2010-07-20re PR debug/45003 (VTA issues with sign/zero extension and debug temporaries)Jakub Jelinek1-1/+1
PR debug/45003 * cfgexpand.c (expand_debug_expr) <case NOP_EXPR>: Use ZERO_EXTEND or SIGN_EXTEND depending on TYPE_UNSIGNED of the operand's type instead of the result's type. * gcc.dg/guality/pr45003-1.c: New test. From-SVN: r162336
2010-07-15tree.h (DECL_CHAIN): Define.Nathan Froyd1-4/+4
gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. From-SVN: r162223