2012-09-20 Martin Jambor <mjambor@suse.cz>
* function.c (push_cfun): Check old current_function_decl matches
old cfun, set new current_function_decl to the decl of the new
cfun.
(push_struct_function): Likewise.
(pop_cfun): Likewise.
(allocate_struct_function): Move call to
invoke_set_current_function_hook to the end of the function.
* cfgexpand.c (estimated_stack_frame_size): Do not set and restore
current_function_decl.
* cgraph.c (cgraph_release_function_body): Likewise.
* cgraphunit.c (cgraph_process_new_functions): Likewise.
(cgraph_add_new_function): Likewise.
(cgraph_analyze_function): Likewise.
(assemble_thunk): Set cfun to NULL at the end.
(expand_function): Move call to set_cfun downwards.
* gimple-low.c (record_vars_into): Only check current_function_decl
before possibly doing push_cfun.
* gimplify.c (gimplify_function_tree): Do not set and restore
current_function_decl.
* ipa-inline-analysis.c (compute_inline_parameters): Likewise.
(inline_analyze_function): Likewise.
* ipa-prop.c (ipa_analyze_node): Likewise.
* ipa-pure-const.c (analyze_function): Likewise.
* lto-streamer-in.c (lto_input_function_body): Do not set
current_function_decl.
* lto-streamer-out.c (output_function): Do not set and restore
current_function_decl.
* omp-low.c (finalize_task_copyfn): Likewise.
(expand_omp_taskreg): Likewise.
(create_task_copyfn): Likewise, move push_cfun up quite a bit.
* passes.c (dump_passes): Do not set and restore current_function_decl.
(do_per_function): Likewise.
(do_per_function_toporder): Likewise.
* trans-mem.c (ipa_tm_scan_irr_function): Likewise.
(ipa_tm_transform_transaction): Likewise.
(ipa_tm_transform_clone): Likewise.
(ipa_tm_execute): Likewise.
* tree-emutls.c (lower_emutls_function_body): Likewise.
* tree-inline.c (initialize_cfun): Do not call pop_cfun.
(tree_function_versioning): Do not call push_cfun, do not set and
restore current_function_decl. Remove assert checking consistency of
cfun and current_function_decl.
* tree-profile.c (tree_profiling): Do not set and restore
current_function_decl.
* tree-sra.c (convert_callers_for_node): Do not set
current_function_decl.
(convert_callers): Do not restore current_function_decl.
(modify_function): Do not set current_function_decl.
* tree-ssa-structalias.c (ipa_pta_execute): Do not set and restore
current_function_decl.
fortran/
* trans-decl.c (gfc_get_extern_function_decl): Push NULL cfun. Do not
set and restore current_function_decl.
(gfc_init_coarray_decl): Do not set and restore current_function_decl.
lto/
* lto.c (lto_materialize_function): Call push_struct_function and
pop_cfun.
From-SVN: r191577
2012-09-20 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54634
* tree-data-ref.c (get_references_in_stmt): For now give
up for pure functions.
From-SVN: r191567
/cp
2012-09-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52432
* pt.c (tsubst_copy_and_build): If tf_error is not set in the complain
argument don't call unqualified_name_lookup_error.
/testsuite
2012-09-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52432
* g++.dg/cpp0x/decltype32.C: Tweak.
From-SVN: r191564
2012-09-19 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (prune_expression_for_jf): New function.
(ipa_set_jf_constant): Use it.
(ipa_set_jf_arith_pass_through): Likewise.
(determine_known_aggregate_parts): Likewise.
From-SVN: r191502
2012-09-19 Steve Ellcey <sellcey@mips.com>
* config.gcc (mips*-mti-elf*): New target.
* config/mips/mti-elf.h: New file.
* config/mips/t-mti-elf: New file.
From-SVN: r191496
* dbgcnt.def (sched_breakdep): New counter.
* haifa-sched.c (update_insn_after_change): New static function,
broken out of haifa_change_pattern.
(haifa_change_pattern): Call it.
(dep_t heap vecs): Declare.
(INSN_COST): Define earlier.
(next_cycle_replace_deps, next_cycle_apply): New static
variables.
(apply_replacement): New static function.
(recompute_todo_spec): New argument FOR_BACKTRACK. All callers
changed. Handle DEP_REPLACE deps.
(contributes_to_priority_p): False for replaceable deps.
(must_restore_pattern_p, restore_pattern): New static functions.
(schedule_insn): Use them. Apply replacements for broken deps.
(struct haifa_saved_data): Add new fields to keep track of
replacements.
(save_backtrack_point): Initialize them.
(undo_replacements_for_backtrack): New static function.
(restore_last_backtrack_point, free_topmost_backtrack_point):
Use it and keep track of replacements.
(perform_replacements_new_cycle, undo_all_replacements): New static
functions.
(schedule_block): Call these two as necessary. Call
find_modifiable_mems.
(try_ready): Tweak the assert. Check for DEP_POSTPONED.
* sched-deps.c: Include "emit-rtl.h".
(init_dep_1): Initialize DEP_NONREG, DEP_MULTIPLE and DEP_REPLACE.
(dep_spec_p): True for DEP_REPLACE deps.
(mark_as_hard): New static variable.
(update_dep): Update DEP_NONREG and DEP_MULTIPLE.
(add_dependence_list): New argument hard. All callers changed. Set
and clear mark_as_hard around function body.
(add_dependence_list_and_free): Likewise.
(haifa_note_mem_dep): Set DEP_NONREG.
(haifa_note_dep): Likewise if mark_as_hard is true.
(sched_analyze_insn): Switch loop with if statement testing for
sel_sched_p.
(struct mem_inc_info): New.
(attempt_change, parse_add_or_inc, find_inc, find_mem): New static
functions.
(find_modifiable_mems): New function.
* sched-int.h (struct dep_replacement): New.
(struct _dep): Add replace, nonreg and multiple fields. Make type and
cost bitfields.
(UNKNOWN_DEP_COST): Change to match the bitfield.
(DEP_NONREG, DEP_MULTIPLE, DEP_REPLACE): New macros.
(DEP_POSTPONED): New macro.
(DEP_CANCELLED): Renumber.
(find_modifiable_mems): Declare.
(enum SCHED_FLAGS): Add DONT_BREAK_DEPENDENCIES.
* sched-rgn.c (init_ready_list): Set TODO_SPEC here.
(new_ready): Don't set HARD_DEP, use DEP_POSTPONED.
(debug_dependencies): Dump DEP_NONREG and DEP_MULTIPLE.
* Makefile.in (sched-deps.o): Update dependencies.
* config/c6x/c6x.c (in_hwloop): New static variable.
(c6x_set_sched_flags): If it is true, add DONT_BREAK_DEPENDENCIES.
(hwloop_optimize): Set and clear it around preliminary scheduling
pass.
From-SVN: r191493
2012-09-19 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* gcc.target/powerpc/ppc-get-timebase.c: New file.
* gcc.target/powerpc/ppc-mftb.c: New file.
From-SVN: r191492
2012-09-19 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* config/rs6000/rs6000-builtin.def: Add __builtin_ppc_get_timebase
and __builtin_ppc_mftb.
* config/rs6000/rs6000.c (rs6000_expand_zeroop_builtin): New
function to expand an expression that calls a built-in without
arguments.
(rs6000_expand_builtin): Add __builtin_ppc_get_timebase and
__builtin_ppc_mftb.
(rs6000_init_builtins): Likewise.
* config/rs6000/rs6000.md (rs6000_get_timebase): New pattern.
(rs6000_get_timebase_ppc32): New pattern.
(rs6000_mftb_<mode>): New pattern.
* doc/extend.texi (PowerPC Built-in Functions): New section.
(PowerPC AltiVec/VSX Built-in Functions):
Move some built-ins unrelated to Altivec/VSX to the new section.
2012-09-19 David Edelsohn <dje.gcc@gmail.com>
* rs6000.md (mac*): Remove extra spaces.
(mulhw*): Same.
From-SVN: r191491
PR target/54089
* config/sh/predicates.md (arith_reg_or_t_reg_operand): New predicate.
* config/sh/sh.md (*rotcr): Use arith_reg_or_t_reg_operand predicate.
Handle the case where one of the operands is T_REG.
Add new pattern to handle MSB extraction.
PR target/54089
* gcc.target/sh/pr54089-1.c (test_11, test_12, test_13, test_14): New
functions.
From-SVN: r191490
PR target/54236
* config/sh/sh.md (*addc): Add pattern to handle one bit left shifts.
PR target/54236
* gcc.target/sh/pr54236-1.c (test_08): Add one bit left shift case.
From-SVN: r191489
PR rtl-optimization/54290
* reload1.c (choose_reload_regs): Also take into account secondary MEMs
to remove address replacements for inherited reloads.
(replaced_subreg): Move around.
From-SVN: r191484