Uros Bizjak [Fri, 3 Aug 2012 17:40:34 +0000 (19:40 +0200)]
sync.md (*atomic_fetch_add_cmp<mode>): Use incdec_operand predicate to return INC or DEC insn mnemonic.
* config/i386/sync.md (*atomic_fetch_add_cmp<mode>): Use
incdec_operand predicate to return INC or DEC insn mnemonic.
Add %K operand modifier.
(atomic_add<mode>): Use incdec_operand predicate to
return INC or DEC insn mnemonic.
(atomic_dec<mode>): Ditto.
Michael Matz [Fri, 3 Aug 2012 14:43:09 +0000 (14:43 +0000)]
re PR middle-end/54146 (Very slow compile with attribute((flatten)))
PR tree-optimization/54146
* cfgexpand.c (add_scope_conflicts_1): Use bitmap_ior_into.
(add_scope_conflicts): Iterate in RPO order.
(add_stack_protection_conflicts): Iterate over the other triangle.
(fini_vars_expansion): Clear stack_vars_sorted.
Marc Glisse [Fri, 3 Aug 2012 12:21:14 +0000 (14:21 +0200)]
re PR tree-optimization/30318 (VRP does not create ANTI_RANGEs on overflow)
gcc/
2012-08-03 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/30318
* double-int.c (mul_double_wide_with_sign): New function.
(mul_double_with_sign): Call the new function.
* double-int.h (mul_double_wide_with_sign): Declare the new function.
* tree-vrp.c (extract_range_from_binary_expr_1) [MULT_EXPR]:
Handle integer types that wrap on overflow.
(quad_int_cmp): New helper function.
(quad_int_pair_sort): Likewise.
gcc/testsuite/
2012-08-03 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/30318
* gcc.dg/tree-ssa/vrp77.c: New testcase.
tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query is_gimple_reg on the SSA name, not its variable.
2012-08-03 Richard Guenther <rguenther@suse.de>
* tree-vect-loop-manip.c (vect_can_advance_ivs_p): Query
is_gimple_reg on the SSA name, not its variable.
(vect_update_ivs_after_vectorizer): Likewise.
* tree-ssa-copyrename.c (rename_ssa_copies): Likewise.
* tree-if-conv.c (if_convertible_phi_p): Likewise.
(predicate_scalar_phi): Likewise.
* tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise.
(vect_analyze_scalar_cycles_1): Likewise.
* tree-ssa-live.c (register_ssa_partition_check): Likewise.
* tree-outof-ssa.c (eliminate_useless_phis): Likewise.
* tree-ssa-reassoc.c (phi_rank): Likewise.
* tree-parloops.c (separate_decls_in_region_name): Use
replace_ssa_name_symbol.
* tree-predcom.c (base_names_in_chain_on): Likewise.
* matrix-reorg.c (update_type_size): Query the type of the SSA name,
not its variable.
* gimple-ssa-strength-reduction.c (create_mul_ssa_cand): Likewise.
(create_mul_imm_cand): Likewise.
(create_add_ssa_cand): Likewise.
(create_add_imm_cand): Likewise.
(slsr_process_add): Likewise.
* tree-inline.c (remap_ssa_name): Do not set the type of the
new SSA_NAME.
* tree-ssa-structalias.c (get_constraint_for_ssa_var): Clarify
assert. Check for default def first.
re PR target/51931 (No support for MIPS16 long branches)
gcc/
PR target/51931
* config/mips/mips-protos.h (mips_strip_unspec_address): Declare.
* config/mips/mips.c (mips_strip_unspec_address): Make extern.
(mips16_rewrite_pool_constant): Make a copy of the pool constant
before adding to a PC-relative table.
(mips16_lay_out_constants): Add a SPLIT_P parameter.
(mips16_load_branch_target, mips16_split_long_branches): New functions.
(mips_reorg): Update call to mips16_lay_out_constants.
Call mips16_split_long_branches.
* config/mips/predicates.md (pc_or_label_operand): Delete.
* config/mips/mips.md (length): Add a calculation for MIPS16 branches.
Move the extended_mips16 handling further down.
(*branch_equality<mode>_mips16): Replace use pc_or_label_operand
with explicit label_ref and pc. Follow the usual operand numbering.
(*branch_equality<mode>_mips16_inverted): New pattern.
(*jump_mips16): Add length attribute.
(indirect_jump_and_restore_<mode>): New pattern.
(consttable_int): Call mips_strip_unspec_address on the operand.
Marc Glisse [Thu, 2 Aug 2012 19:54:43 +0000 (21:54 +0200)]
re PR tree-optimization/53805 (combine_comparisons changes trapping behavior)
2012-08-02 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/53805
* gcc/fold-const.c (invert_tree_comparison): Invert ORDERED_EXPR and
UNORDERED_EXPR even for trapping floating point.
* gcc/testsuite/gcc.dg/fold-notunord.c: New testcase.
Mikael Morin [Thu, 2 Aug 2012 19:48:50 +0000 (19:48 +0000)]
re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)
fortran/
PR fortran/48820
* trans-array.c (gfc_conv_ss_startstride): Set the intrinsic
result's lower and upper bounds according to the rank.
(set_loop_bounds): Set the loop upper bound in the intrinsic case.
testsuite/
PR fortran/48820
* gfortran.dg/assumed_rank_bounds_1.f90: New test.
* gfortran.dg/assumed_rank_bounds_2.f90: New test.
Mikael Morin [Thu, 2 Aug 2012 19:20:43 +0000 (19:20 +0000)]
trans-array.h (gfc_conv_descriptor_rank): New prototype.
* trans-array.h (gfc_conv_descriptor_rank): New prototype.
* trans-array.c (gfc_conv_descriptor_rank): New function moved and
renamed ...
* trans-intrinsic.c (get_rank_from_desc): ... from this one.
(gfc_conv_intrinsic_rank, gfc_conv_intrinsic_bound,
gfc_conv_associated): Also rename function calls.
Mikael Morin [Thu, 2 Aug 2012 19:10:38 +0000 (19:10 +0000)]
iresolve.c (resolve_bound, [...]): Don't set the shape for assumed rank arrays.
* iresolve.c (resolve_bound, gfc_resolve_shape):
Don't set the shape for assumed rank arrays.
* simplify.c (gfc_simplify_shape): Don't try to simplify if the
argument is assumed rank.
Jason Merrill [Thu, 2 Aug 2012 18:44:58 +0000 (14:44 -0400)]
PR c++/51213 (again)
/cp
2012-08-02 Jason Merrill <jason@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51213 (again)
* pt.c (type_unification_real): Call push_deferring_access_checks /
pop_deferring_access_checks around the substitution of default
template args.
(instantiate_template_1): When the specialization returned by
retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
are in a SFINAE context, simply return error_mark_node.
* cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
/testsuite
2012-08-02 Jason Merrill <jason@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
H.J. Lu [Thu, 2 Aug 2012 16:58:33 +0000 (16:58 +0000)]
Add free inline summary pass after pass_early_local_passes
PR middle-end/53321
PR middle-end/53865
* ipa-inline-analysis.c (inline_free_summary): Return if
inline_edge_summary_vec is NULL.
* ipa-split.c (execute_split_functions): Check if a function
is inlinable only if inline_edge_summary_vec != NULL.
* ipa.c (symtab_remove_unreachable_nodes): Restore
cgraph_propagate_frequency call when something was changed.
(free_inline_summary): New function.
(pass_ipa_free_inline_summary): New pass.
* passes.c (init_optimization_passes): Add
pass_ipa_free_inline_summary before pass_ipa_tree_profile.
Michael Matz [Thu, 2 Aug 2012 12:24:52 +0000 (12:24 +0000)]
tree-ssa-live.c (set_is_used): Return a bool.
* tree-ssa-live.c (set_is_used): Return a bool.
(mark_all_vars_used): Don't take data argument.
(mark_all_vars_used_1): Adjust calls to above, merge handling
of local and global vars.
(remove_unused_scope_block_p): Don't take global_unused_vars,
merge handling of local and global vars.
(remove_unused_locals): Don't allocate/fill/pass global_unused_vars,
use is_used_p for local and global vars.
Janus Weil [Thu, 2 Aug 2012 08:57:58 +0000 (10:57 +0200)]
re PR fortran/54147 ([F03] Interface checks for PPCs & deferred TBPs)
2012-08-02 Janus Weil <janus@gcc.gnu.org>
PR fortran/54147
* resolve.c (check_proc_interface): New routine for PROCEDURE interface
checks.
(resolve_procedure_interface,resolve_typebound_procedure,
resolve_fl_derived0): Call it.
Alexandre Oliva [Thu, 2 Aug 2012 00:34:26 +0000 (00:34 +0000)]
re PR debug/52983 (internal compiler error: in df_uses_record, at df-scan.c:3243)
PR debug/52983
* valtrack.c (cleanup_auto_inc_dec): Implement unconditionally,
falling back to copy_rtx on non-autoinc machines.
(propagate_for_debug_subst): Always use cleanup_auto_inc_dec.
Thomas Koenig [Wed, 1 Aug 2012 21:43:50 +0000 (21:43 +0000)]
re PR fortran/54033 (gfortran: Passing file as include directory - add diagnostic and ICE with -cpp)
2012-08-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/54033
* scanner.c (add_path_to_list): Emit warning if an error occurs
for an include path, if it is not present or if it is not a
directory. Do not add the path in these cases.
2012-08-01 Thomas König <tkoenig@gcc.gnu.org>
PR fortran/54033
* gfortran.dg/include_6.f90: New test case.
* gfortran.dg/include_7.f90: New test case.
* gfortran.dg/include_3.f90: Add dg-warning for missing directory.
re PR middle-end/34548 (GCC generates too many alignment adds for alloca)
PR 34548
* function.h (struct rtl_data): Add max_dynamic_stack_alignment.
* cfgexpand.c (gimple_expand_cfg): Initialise it.
* explow.c (allocate_dynamic_stack_space): Set it. Simplify
alignment requirements given the known alignment of dynamic_offset.
* function.c (instantiate_virtual_regs): Align dtnamic_offset.
* tree-flow-inline.h (referenced_var): Remove.
* tree-ssa-coalesce.c (create_outofssa_var_map): Remove duplicate
checking code.
* tree-sra.c (candidates): New global hashtable.
(candidate): New function.
(sra_initialize): Initialize candidates.
(sra_deinitialize): Free candidates.
(disqualify_candidate): Remove candidate from candidates.
(maybe_add_sra_candidate): New function.
(find_var_candidates): Walk over all local decls and parameters,
add candidates to candidates hashtable.
(find_param_candidates): Add candidates to candidates hashtable.
(analyze_all_variable_accesses): Use candidate instead of
referenced_var.
Tom de Vries [Wed, 1 Aug 2012 16:53:05 +0000 (16:53 +0000)]
tree-vrp.c (find_case_label_ranges): New function.
2012-08-01 Tom de Vries <tom@codesourcery.com>
* tree-vrp.c (find_case_label_ranges): New function.
(vrp_visit_switch_stmt, simplify_switch_using_ranges): Use
find_case_label_ranges instead of find_case_label_range. Handle second
range.
* tree-complex.c (init_parameter_lattice_values): Don't call var_ann.
* tree-dfa.c (struct dfa_stats_d): Remove num_var_anns member.
(dump_dfa_stats): Don't dump stats about var anns.
(collect_dfa_stats): Don't collect them.
(add_referenced_var_1): Don't set var annotation pointers.
(remove_referenced_var): Ditto, and only remove it it's in the
hash table.
* tree-inline.c (remapped_type): Remove.
(can_be_nonlocal): Most variable will be considered live here,
return false earlier.
(remap_decls): Don't call var_ann, all variables will be considered
referenced here.
(copy_debug_stmt): Ditto, and use is_global_var.
* tree-into-ssa.c (rewrite_debug_stmt_uses): Use get_current_def to
determine if a variable was referred to, not var_ann.
* tree-ssa-live.c (remove_unused_scope_block_p): Don't check var_ann.
(remove_unused_locals): Ditto.
* tree-ssa.c (delete_tree_ssa): Don't free/clear var ann pointers.
* tree-tailcall.c (arg_needs_copy_p): Don't check var_ann.
* tree.c (copy_node_stat): Don't clear var ann pointer.
* tree.h (tree_result_decl, tree_parm_decl, tree_var_decl): Remove
ann member.
(DECL_VAR_ANN_PTR): Remove.
* tree-flow.h (struct var_ann_d): Rename used member.
(set_is_used): Don't declare.
* tree-flow-inline.h (clear_is_used): Remove.
(set_is_used, is_used_p): Move to ...
* tree-ssa-live.c (set_is_used, is_used_p): ... here, and use
on the side bitmap.
(usedvars): New bitmap.
(dump_scope_block): Don't dump unusedness.
(remove_unused_locals): Allocate and free usedvars.
* tree-nrv.c (tree_nrv): Don't clear used flags here.
* tree-flow.h (struct var_ann_d): Remove base_var_processed and
base_index members.
* tree-ssa-live.h (struct _var_map): Remove basevars member.
(VAR_ANN_BASE_INDEX): Remove.
* tree-ssa-live.c (var_map_base_init): Use a hash table instead
of var annotation to compress index space. Don't deal with above
removed members.
(var_map_base_fini): Don't free basevars.
(init_var_map): Don't clear basevars.
* config/i386/i386.c (ix86_address_subreg_operand): Reject
stack pointer.
(ix86_print_operand_address): Assert that parts.base and parts.index
are non-NULL after call to simplify_subreg.
Alan Modra [Tue, 31 Jul 2012 22:14:44 +0000 (07:44 +0930)]
re PR target/54131 (ICE building 416.gamess, reload_cse_simplify_operands)
PR target/54131
* config/rs6000/rs6000.c (mem_operand_gpr): Don't limit range
of lo_sum offsets. Comment. Assert mode at least word size
rather than bypassing powerpc64 word offset check.
Bill Schmidt [Tue, 31 Jul 2012 21:08:41 +0000 (21:08 +0000)]
rs6000.c (rs6000_builtin_vectorization_cost): Revise costs for vec_perm and vec_promote_demote down to more natural values.
2012-07-31 Bill Schmidt <wschmidt@linux.ibm.com>
* config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Revise
costs for vec_perm and vec_promote_demote down to more natural values.
(struct _rs6000_cost_data): New data structure.
(rs6000_density_test): New function.
(rs6000_init_cost): Change to use rs6000_cost_data.
(rs6000_add_stmt_cost): Likewise.
(rs6000_finish_cost): Perform density test when vectorizing a loop.
Janus Weil [Tue, 31 Jul 2012 18:32:41 +0000 (20:32 +0200)]
re PR fortran/42418 (PROCEDURE: Rejects interface which is both specific and generic procedure)
2012-07-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/42418
* decl.c (match_procedure_interface): Move some checks to
'resolve_procedure_interface'. Set flavor if appropriate.
* expr.c (gfc_check_pointer_assign): Cleanup of 'gfc_is_intrinsic'.
* intrinsic.c (gfc_is_intrinsic): Additional checks for attributes which
identify a procedure as being non-intrinsic.
* resolve.c (resolve_procedure_interface): Checks moved here from
'match_procedure_interface'. Minor cleanup.
(resolve_formal_arglist,resolve_symbol): Cleanup of
'resolve_procedure_interface'
(resolve_actual_arglist,is_external_proc): Cleanup of
'gfc_is_intrinsic'.
Steven Bosscher [Tue, 31 Jul 2012 18:24:40 +0000 (18:24 +0000)]
sched-vis.c (print_exp): Handle FMA explicitly.
* sched-vis.c (print_exp): Handle FMA explicitly. Simplify handling
of RTX_UNARY function-like operations. Print unknown expression
RTX classes as pseudo-functions.
(print_pattern): Simplify return pattern printing.
(dump_insn_slim): Print the value of notes as a pattern for proper
printing of CFA notes.
Steven Bosscher [Tue, 31 Jul 2012 11:48:56 +0000 (11:48 +0000)]
sched-vis.c (dump_insn_slim): Print print_rtx_head at the start of each new line.
* sched-vis.c (dump_insn_slim): Print print_rtx_head at the
start of each new line.
* final.c (final_scan_insn): If the final dump is requested as
slim RTL, dump slim RTL to the assembly file also.
Steven Bosscher [Tue, 31 Jul 2012 09:20:56 +0000 (09:20 +0000)]
re PR pch/53880 (compile time regression when generating precompiled headers for boost)
PR pch/53880
* gengtype.c (struct walk_type_data): Add have_this_obj field.
(walk_type): For functions that take a this_obj argument and
that process fields with a GTY((length)) argument, write the
test that write_types_local_process_field will write also at the
head of the loop, effectively unswitching the loop.
(write_func_for_structure, write_local_func_for_structure): Clear
have_this_obj before calling walk_type.
(write_local_func_for_structure): Set have_this_obj before walk_type.
(write_array): Set have_this_obj for output of local pointer walking
functions but not for marker functions.
(write_types_local_process_field): Assert have_this_obj is set.
* rtl.h (simplify_using_condition): Adjust prototype using bitmap
from coretypes.h.
Nick Clifton [Tue, 31 Jul 2012 09:09:29 +0000 (09:09 +0000)]
lib2funcs.c (__clrsbhi2): New function.
* config/stormy16/lib2funcs.c (__clrsbhi2): New function.
Implements __clrsb for an HImode argument.
* config/stormy16/clrsbhi2.c: New file:
* config/stormy16/t-stormy16 (LIB2ADD): Add clrsbhi2.c.
* expmed.h (NUM_MODE_VECTOR_INT): Define.
(struct expmed_op_cheap, struct expmed_op_costs): New structures.
(struct target_expmed): Convert x_mul_highpart_cost and
x_mul_widen_cost fields to be indexed by integer modes.
Convert x_sdiv_pow2_cheap and x_smod_pow2_cheap fields to be
of type struct expmed_op_cheap. Convert other cost fields to be
of type struct_expmed_op_costs.
(mul_widen_cost_ptr, mul_highpart_cost_ptr): Adjust for new
indexing of respective fields.
(expmed_op_cheap_ptr): New function.
(sdiv_pow2_cheap_ptr, smod_pow2_cheap_ptr): Call it.
(expmed_op_cost_ptr): New function.
(add_cost_ptr, neg_cost_ptr, shift_cost_ptr, shiftadd_cost_ptr,
shiftsub0_cost_ptr, shiftsub1_cost_ptr, mul_cost_ptr,
sdiv_cost_ptr, udiv_cost_ptr): Call it.
Janus Weil [Mon, 30 Jul 2012 19:55:41 +0000 (21:55 +0200)]
re PR fortran/51081 ([F03] Proc-pointer assignment: Rejects valid internal proc)
2012-07-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/51081
* gfortran.h (gfc_resolve_intrinsic): Add prototype.
* expr.c (gfc_check_pointer_assign): Set INTRINSIC attribute if needed.
Check for invalid intrinsics.
* primary.c (gfc_match_rvalue): Check for intrinsics came too early.
Set procedure flavor if appropriate.
* resolve.c (resolve_intrinsic): Renamed to gfc_resolve_intrinsic.
(resolve_procedure_interface,resolve_procedure_expression,
resolve_function,resolve_fl_derived0,resolve_symbol): Ditto.
* gnatcmd.adb, makeutl.adb, makeutl.ads: Minor code reorganization.
2012-07-30 Vincent Pucci <pucci@adacore.com>
* exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Minor
reformatting.
* sem_ch9.adb (Allows_Lock_Free_Implementation): Minor reformatting.
Capture the correct error message in case of a quantified expression.
2012-07-30 Thomas Quinot <quinot@adacore.com>
* g-socket.adb (Get_Socket_Option, Set_Socket_Option): On Windows, the
value is a milliseconds count in a DWORD, not a struct timeval.
* sem_ch12.adb (Earlier): Add local variables T1 and T2. Minor code
refactoring.
2012-07-30 Thomas Quinot <quinot@adacore.com>
* gnatcmd.adb, make.adb, makeutl.adb, makeutl.ads
(Test_If_Relative_Path): Rename to Ensure_Absolute_Path to better
reflect what this subprogram does. Rename argument Including_L_Switch
to For_Gnatbind, and also exempt -A from rewriting.
* bindusg.adb: Document optional =file argument to gnatbind -A.
2012-07-30 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Entity): Do no apply restriction check on
storage pools to access to subprogram types.
* target.def (vector_alignment): New target hook.
* doc/tm.texi.in (TARGET_VECTOR_ALIGNMENT): Document new hook.
* doc/tm.texi: Regenerate.
* targhooks.c (default_vector_alignment): New function.
* targhooks.h (default_vector_alignment): Add prototype.
* stor-layout.c (layout_type): Use targetm.vector_alignment.
* config/arm/arm.c (arm_vector_alignment): New function.
(TARGET_VECTOR_ALIGNMENT): Define.
* tree-vect-data-refs.c (vect_update_misalignment_for_peel): Use
vector type alignment instead of size.
* tree-vect-loop-manip.c (vect_do_peeling_for_loop_bound): Use
element type size directly instead of computing it from alignment.
Fix variable naming and comment.
testsuite/ChangeLog:
* lib/target-supports.exp
(check_effective_target_vect_natural_alignment): New function.
* gcc.dg/align-2.c: Only run on targets with natural alignment
of vector types.
* gcc.dg/vect/slp-25.c: Adjust tests for targets without natural
alignment of vector types.
Co-Authored-By: Richard Earnshaw <rearnsha@arm.com>
From-SVN: r189974
Richard Guenther [Mon, 30 Jul 2012 11:18:15 +0000 (11:18 +0000)]
tree-into-ssa.c (mark_def_sites): Also process virtual operands.
2012-07-30 Richard Guenther <rguenther@suse.de>
* tree-into-ssa.c (mark_def_sites): Also process virtual operands.
(rewrite_stmt): Likewise.
(rewrite_enter_block): Likewise.
(pass_build_ssa): Do not update virtual SSA form during TODO.
(mark_symbol_for_renaming): Do nothing if we are not in SSA form.
* lto-streamer-in.c (lto_read_body): Set in_ssa_p earlier.
gengtype.c (adjust_field_type): Diagnose duplicate "length" option applications and option being applied to...
gcc:
2012-07-27 Laurynas Biveinis <laurynas.biveinis@gmail.com>
Steven Bosscher <steven@gcc.gnu.org>
* gengtype.c (adjust_field_type): Diagnose duplicate "length"
option applications and option being applied to arrays of atomic
types.
(walk_type): Allow "atomic" option on strings too.
* dwarf2out.h (struct dw_vec_struct): Use the "atomic" GTY option
for the array field.
* vec.h: Describe the atomic object "A" type of the macros in
the header comment.
(VEC_T_GTY_ATOMIC, DEF_VEC_A, DEF_VEC_ALLOC_A): Define.
* emit-rtl.c (locations_locators_vals): use the atomic object
vector.
* doc/gty.texi: Clarify that GTY option "length" is only for
arrays of non-atomic objects. Fix typo in the description of the
"atomic" option.