Thomas Koenig [Sun, 15 Apr 2012 11:52:44 +0000 (11:52 +0000)]
re PR libfortran/38199 (missed optimization: I/O performance)
2012-04-15 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/38199
PR libfortran/50673
* intrinsics/string_intriniscs_inc.c (string_len_trim):
Remove prototypes for string_len_trim and move to...
* libgfortran.h (string_len_trim): ... here and
(string_len_trim_char4): ...here.
* io/unit.c: For non-array internal arrays where we do reading,
adjust the record length to the last non-blank character.
* io/unix.c: Fix typo.
Paolo Carlini [Sat, 14 Apr 2012 22:33:22 +0000 (22:33 +0000)]
re PR libstdc++/52699 (infinite loop generated with -O0)
2012-04-14 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/52699
* include/bits/random.tcc (independent_bits_engine<>::operator()())
Avoid various overflows; use common_type on result_type and
_RandomNumberEngine::result_type; avoid floating point computations;
other smaller tweaks.
* include/bits/random.tcc (uniform_int_distribution<>::operator())
Use common_type; assume _UniformRandomNumberGenerator::result_type
unsigned; tidy.
* include/bits/stl_algobase.h (__lg(unsigned), __lg(unsigned long),
__lg(unsigned long long)): Add.
* config/i386/sse.md (ssse3_plusminus): New code iterator.
(avx2_ph<plusminus_mnemonic>wv16hi3): Macroize insn from
avx2_ph{add,adds,sub,subs}wv16hi3 using ssse3_plusminus code iterator.
(ssse3_ph<plusminus_mnemonic>wv8hi3): Macroize insn from
ssse3_ph{add,adds,sub,subs}wv8hi3 using ssse3_plusminus code iterator.
(ssse3_ph<plusminus_mnemonic>wv4hi3): Macroize insn from
ssse3_ph{add,adds,sub,subs}wv4hi3 using ssse3_plusminus code iterator.
(avx2_ph<plusminus_mnemonic>dv8si3): Macroize insn from
avx2_ph{add,adds,sub,subs}dv8si3 using plusminus code iterator.
(ssse3_ph<plusminus_mnemonic>dv4si3): Macroize insn from
ssse3_ph{add,adds,sub,subs}dv4si3 using plusminus code iterator.
(ssse3_ph<plusminus_mnemonic>dv2si3): Macroize insn from
ssse3_ph{add,adds,sub,subs}dv2si3 using plusminus code iterator.
(xop_plus): New code iterator.
(macs): New code attribute.
(macds): Ditto.
(xop_p<macs><ssemodesuffix><ssemodesuffix>): Macroize insn from
xop_pmacs{,s}{ww,dd} using xop_plus code iterator and VI24_128 mode
iterator.
(xop_p<macs>dql): Macroize insn from xop_pmacs{,s}dql using
xop_plus code iterator.
(xop_p<macs>dqh): Macroize insn from xop_pmacs{,s}dqh using
xop_plus code iterator.
(xop_p<macs>wd): Macroize insn from xop_pmacs{,s}wd using
xop_plus code iterator.
(xop_p<madcs>wd): Macroize insn from xop_pmadcs{,s}wd using
xop_plus code iterator.
(xop_phadd<u>bw): Macroize insn from xop_phadd{,u}bw usign
any_extend code iterator.
(xop_phadd<u>bd): Macroize insn from xop_phadd{,u}bd usign
any_extend code iterator.
(xop_phadd<u>bq): Macroize insn from xop_phadd{,u}bq usign
any_extend code iterator.
(xop_phadd<u>wd): Macroize insn from xop_phadd{,u}wd usign
any_extend code iterator.
(xop_phadd<u>wq): Macroize insn from xop_phadd{,u}wq usign
any_extend code iterator.
(xop_phadd<u>dq): Macroize insn from xop_phadd{,u}dq usign
any_extend code iterator.
Tom de Vries [Sat, 14 Apr 2012 12:17:41 +0000 (12:17 +0000)]
cfgcleanup.c (try_optimize_cfg): Replace call to delete_insn_chain by call to delete_insn.
2012-04-14 Tom de Vries <tom@codesourcery.com>
* cfgcleanup.c (try_optimize_cfg): Replace call to delete_insn_chain by
call to delete_insn. Remove code to reorder BASIC_BLOCK note and
DELETED_LABEL note, and move it to ...
* cfgrtl.c (delete_insn): ... here. Change return type to void.
(delete_insn_and_edges): Likewise.
(delete_insn_chain): Handle new return type of delete_insn. Delete
chain backwards rather than forwards.
* rtl.h (delete_insn, delete_insn_and_edges): Change return type to
void.
* cfglayout.c (fixup_reorder_chain): Delete unused label.
Tom de Vries [Sat, 14 Apr 2012 05:49:15 +0000 (05:49 +0000)]
tree-ssa-tail-merge.c (stmt_local_def): New function, factored out of same_succ_hash, with local_def inlined.
2012-04-14 Tom de Vries <tom@codesourcery.com>
* tree-ssa-tail-merge.c (stmt_local_def): New function, factored out of
same_succ_hash, with local_def inlined. Use SINGLE_SSA_DEF_OPERAND.
Use FOR_EACH_IMM_USE_FAST instead of FOR_EACH_IMM_USE_STMT. Remove use
of find_edge.
(gsi_advance_fw_nondebug_nonlocal): New function.
(local_def): Removed function.
(same_succ_hash): Use stmt_local_def.
(same_succ_equal): Use gsi_advance_fw_nondebug_nonlocal.
(gsi_advance_bw_nondebug_nonlocal): Use stmt_local_def.
Martin Jambor [Fri, 13 Apr 2012 17:12:33 +0000 (19:12 +0200)]
expr.c (expand_expr_real_1): Pass type, not the expression, to set_mem_attributes for a memory temporary.
2012-04-13 Martin Jambor <mjambor@suse.cz>
* expr.c (expand_expr_real_1): Pass type, not the expression, to
set_mem_attributes for a memory temporary. Do not call the function
for the memory temporary created for a bitfield.
re PR debug/51570 (FAIL: gcc.dg/guality/pr45003-[23].c)
PR debug/51570
* var-tracking.c (expand_depth): New type.
(onepart_aux, expand_loc_callback_data): Change depth type to it.
(loc_exp_dep_alloc): Adjust initializer.
(update_depth): Use new type. Add entryvals.
(vt_expand_var_loc_chain): Take note of expansions with
ENTRY_VALUEs, but don't accept them right away. Run an optional
second pass accepting the minimum ENTRY_VALUE count found in the
first pass.
(vt_expand_loc_callback, INIT_ELCD): Adjust.
Tom de Vries [Fri, 13 Apr 2012 14:53:07 +0000 (14:53 +0000)]
tree-ssa-tail-merge.c (gsi_advance_bw_nondebug_nonlocal): Add parameters vuse and vuse_escaped.
2012-04-13 Tom de Vries <tom@codesourcery.com>
* tree-ssa-tail-merge.c (gsi_advance_bw_nondebug_nonlocal): Add
parameters vuse and vuse_escaped.
(find_duplicate): Init vuse1, vuse2 and vuse_escaped. Pass to
gsi_advance_bw_nondebug_nonlocal. Return if vuse_escaped and
vuse1 != vuse2.
Richard Guenther [Fri, 13 Apr 2012 12:22:16 +0000 (12:22 +0000)]
re PR tree-optimization/52969 (ICE in in get_expr_operands, at tree-ssa-operands.c:1035 with -ftree-loop-if-convert-stores)
2012-04-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52969
* tree-if-conv.c (predicate_mem_writes): Properly gimplify
the condition for the COND_EXPR and handle predicate negation
by swapping the COND_EXPR arms.
re PR rtl-optimization/52203 (ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags)
Revert the 2012-03-07 fix for PR 52203.
* sel-sched.c (reset_sched_cycles_in_current_ebb): Check that
the insn does not modify DFA right before issuing, adjust
issue_rate accordingly.
Benjamin Kosnik [Fri, 13 Apr 2012 00:33:10 +0000 (00:33 +0000)]
unordered_map.h (__unordered_map): Remove.
2012-04-12 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/unordered_map.h (__unordered_map): Remove.
(__unordered_multimap): Remove.
Add aliases for __umap_traits, __umap_hashtable, __ummap_traits,
__ummap_hashtable.
(unordered_map): Derive from __umap_hashtable.
(unordered_multimap): Derive from __ummap_hashtable.
* include/bits/unordered_set.h (__unordered_set): Remove.
(__unordered_multiset): Remove.
Add aliases for __uset_traits, __uset_hashtable, __umset_traits,
__umset_hashtable.
(unordered_set): Derive from __uset_hashtable.
(unordered_multiset): Derive from __umset_hashtable.
* include/bits/hashtable.h (__cache_default): New, consolidated
cache defaults for _Hashtable. Adjust comments for doxygen.
(_Hashtable): Consolidate bool template parameters into new,
_Traits class. Inherited base classes synthesize _Hashtable in
CRTP via original 10 parameters. Prefer using declarations to
typedefs, add __node_type, __bucket_type, etc. Push many nested
types down hierarchy to _Hashtable_base. Add constructors
necessary for top-level unordered_containers. Consolidate insert
member functions and logic in new base class, __detail::_Insert
and __detail::_Insert_base.
(_Hashtable::operator=(initializer_list)): Add.
* include/bits/hashtable_policy.h: Convert to doxygen markup.
(_Hashtable_traits) New. Consolidate bool template parameters here.
(_Insert, _Insert_base): New, consolidated insert member functions.
(_Map_base, _Equality, _Rehash_base): Adjust template parameters,
use base types.
(_Hashtable_base): Move type declarations useful to other base
classes into this class.
* python/libstdcxx/v6/printers.py (Tr1HashtableIterator): Update.
* testsuite/23_containers/unordered_set/instantiation_neg.cc:
Adjust traits, line numbers.
PR target/52828
* config/rs6000/rs6000.c (rs6000_emit_stack_tie): Rewrite with
tie regs on destination of sets. Delete forward declaration.
(rs6000_emit_stack_reset): Update rs6000_emit_stack_tie calls.
(rs6000_emit_prologue): Likewise.
(rs6000_emit_epilogue): Likewise. Use in place of gen_frame_tie
and gen_stack_tie.
(is_mem_ref): Use tie_operand to recognise stack ties.
* config/rs6000/predicates.md (tie_operand): New.
* config/rs6000/rs6000.md (restore_stack_block): Generate new
stack tie rtl.
(restore_stack_nonlocal): Likewise.
(stack_tie): Update.
(frame_tie): Delete.
Fix PR52822 (stable_partition move-assigns object to itself) by scanning for...
Fix PR52822 (stable_partition move-assigns object to itself) by
scanning for the first value that doesn't match the predicate before
starting to rearrange values.
2012-04-03 Jeffrey Yasskin <jyasskin@google.com>
PR libstdc++/52822
* include/bits/stl_algo.h (__find_if_not): Expose in
C++98 mode.
(__find_if_not_n): Like __find_if_not, but works on and updates a
counted range instead of a bounded range.
(stable_partition): Guarantee !__pred(*__first) in call to
__stable_partition_adaptive() or __inplace_stable_partition().
(__stable_partition_adaptive): Use new precondition to avoid
moving/copying objects onto themselves. Guarantee new
precondition to recursive calls.
(__inplace_stable_partition): Use new precondition to simplify
base case, remove __last parameter. Guarantee new precondition to
recursive calls.
* testsuite/25_algorithms/stable_partition/moveable.cc (test02):
Test a sequence that starts with a value matching the predicate.
* testsuite/25_algorithms/stable_partition/pr52822.cc:
Test vectors, which have a destructive self-move-assignment.
re PR target/52932 (AVX2 intrinsic _mm256_permutevar8x32_ps has wrong parameter type)
PR target/52932
* config/i386/avx2intrin.h (_mm256_permutevar8x32_ps): Change second
argument type to __m256i. Update call to __builtin_ia32_permvarsf256.
* config/i386/sse.md (UNSPEC_VPERMVAR): New.
(UNSPEC_VPERMSI, UNSPEC_VPERMSF): Remove.
(avx2_permvarv8sf, avx2_permvarv8si): Switch operands 1 and 2.
(avx2_permvar<mode>): Macroize insn from avx2_permvarv8sf and
avx2_permvarv8si using VI4F_256 mode iterator.
* config/i386/i386.c (bdesc_args) <__builtin_ia32_permvarsf256>:
Update builtin type to V8SF_FTYPE_V8SF_V8SI.
(ix86_expand_vec_perm): Update calls to gen_avx2_permvarv8si and
gen_avx2_permvarv8sf.
(expand_vec_perm_pshufb): Ditto.
testsuite/ChangeLog:
PR target/52932
* gcc.target/i386/avx2-vpermps-1.c (avx2_test): Use __m256i type for
second function argument.
* gcc.target/i386/avx2-vpermps-2.c (init_permps): Update declaration.
(calc_permps): Update declaration. Calculate result correctly.
(avx2_test): Change src2 type to union256i_d.
* gcc.target/i386/avx2-vpermd-2.c (calc_permd): Calculate result
correctly.
Michael Meissner [Thu, 12 Apr 2012 17:10:27 +0000 (17:10 +0000)]
re PR target/52775 (Change default for using FCFID instruction)
[gcc]
2012-04-11 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/52775
* config/rs6000/rs6000.h (TARGET_FCFID): Add TARGET_PPC_GPOPT to
the list of options to enable the FCFID instruction.
(TARGET_EXTRA_BUILTINS): Adjust comment.
[gcc/testsuite]
2012-04-11 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/52775
* gcc.target/powerpc/pr52775.c: New file.
Bill Schmidt [Thu, 12 Apr 2012 16:15:13 +0000 (16:15 +0000)]
re PR tree-optimization/18589 (could optimize FP multiplies better)
gcc:
2012-04-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/18589
* tree-ssa-reassoc.c (reassociate_stats): Add two fields.
(operand_entry): Add count field.
(add_repeat_to_ops_vec): New function.
(completely_remove_stmt): Likewise.
(remove_def_if_absorbed_call): Likewise.
(remove_visited_stmt_chain): Remove feeding builtin pow/powi calls.
(acceptable_pow_call): New function.
(linearize_expr_tree): Look for builtin pow/powi calls and add operand
entries with repeat counts when found.
(repeat_factor_d): New struct and associated typedefs.
(repeat_factor_vec): New static vector variable.
(compare_repeat_factors): New function.
(get_reassoc_pow_ssa_name): Likewise.
(attempt_builtin_powi): Likewise.
(reassociate_bb): Call attempt_builtin_powi.
(fini_reassoc): Two new calls to statistics_counter_event.
gcc/testsuite:
2012-04-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* dbgcnt.def (ira_move): New counter.
* ira-int.h (ira_create_new_reg): Declare function.
(first_moveable_pseudo, last_moveable_pseudo): Declare variables.
* ira-emit.c (ira_create_new_reg): Renamed from craete_new_reg and
no longer static. All callers changed.
* ira.c: Include "dbgcnt.h".
(rtx_moveable_p, insn_dominated_by_p, find_moveable_pseudos,
move_unallocated_pseudos): New static functions.
(first_moveable_pseudo, last_moveable_pseudo): New global variables.
(pseudo_replaced_reg, pseudo_move_insn): New static variables.
(ira): Call find_moveable_pseudos and move_unallocated_pseudos.
* ira-costs.c (find_costs_and_classes): Assign a memory cost of zero
to the pseudos generated in find_moveable_pseudos.
* Makefile.in (ira.o): Add $(DBGCNT_H).
Richard Guenther [Thu, 12 Apr 2012 11:38:47 +0000 (11:38 +0000)]
re PR tree-optimization/52943 (likely wrong code bug caused by predictive commoning)
2012-04-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52943
* tree-chrec.h (chrec_is_positive): Remove.
* tree-scalar-evolution.c (chrec_is_positive): Move ...
* tree-data-ref.c (chrec_is_positive): ... here. Make static.
Return false for a constant zero instead of negative.
(analyze_siv_subscript_cst_affine): Handle zero difference
in the initial condition explicitely.
Richard Guenther [Thu, 12 Apr 2012 10:13:22 +0000 (10:13 +0000)]
tree-parloops.c (parallelize_loops): Also consult the upper bound for the number of iterations.
2012-04-12 Richard Guenther <rguenther@suse.de>
* tree-parloops.c (parallelize_loops): Also consult the upper
bound for the number of iterations.
* tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise.
(loop_prefetch_arrays): Likewise.
sh.h (RETURN_ADDR_RTX): Use NULL_RTX instead of 0.
* config/sh/sh.h (RETURN_ADDR_RTX): Use NULL_RTX instead of 0.
* config/sh/sh.c (INSN_REGMODE_WEIGHT, CURR_REGMODE_PRESSURE):
Fix line width.
(dump_table): Use bool type for need_align and have_df variables.
(find_barrier, sfunc_uses_reg): Use NULL_RTX instead of 0.
(regs_used): Remove register modifier.
(barrier_align): Move variables slot, credit, jump_to_next
into if block above for loop. Use bool type for jump_to_next.
(sh_function_arg): Use NULL_RTX instead of 0.
re PR c++/52465 (g++ rejects valid code with in-class using declaration)
gcc/testsuite/ChangeLog
2012-04-09 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52465
* g++.dg/lookup/using52.C: New.
gcc/cp/ChangeLog
2012-04-09 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52465
* parser.c (cp_parser_class_name): Call strip_using_decl and
return the target decl.
* name-lookup.c (strip_using_decl): Returns NULL_TREE if the decl
to be stripped is NULL_TREE.
(qualify_lookup): Call strip_using_decl and perform some checks on
the target decl.
H.J. Lu [Wed, 11 Apr 2012 17:34:08 +0000 (17:34 +0000)]
Check [SUB]SUBTARGET_OVERRIDE_OPTIONS after TARGET_64BIT
* config/i386/i386.c (ix86_option_override_internal): Check
SUBTARGET_OVERRIDE_OPTIONS and SUBSUBTARGET_OVERRIDE_OPTIONS
after TARGET_64BIT is updated.
* config/sh/sh.h (SIDI_OFF): Remove.
* config/sh/sh.md: Use gen_highpart and gen_lowpart to access
DImode subregs instead of gen_rtx_REG or simplifly_gen_subreg
or operand_subword.
Andrew Haley [Wed, 11 Apr 2012 10:47:43 +0000 (10:47 +0000)]
jcf.h (bootstrap_method): New.
2012-04-11 Andrew Haley <aph@redhat.com>
* jcf.h (bootstrap_method): New.
(BootstrapMethods): New.
(JCF): Add BootstrapMethods.
(enum cpool_tag): Add MethodHandle, MethodType, and InvokeDynamic.
* jcf-reader.c (jcf_parse_bootstrap_methods): New.
(jcf_parse_constant_pool): Handlers for MethodHandle, MethodType,
and InvokeDynamic.
(jcf_parse_bootstrap_methods): New.
* javaop.def (invokedynamic): New opcode.
* jcf-parse.c (get_constant): An unknown constant type should not
be an internal error, but a fatal one. Make it so.
* jcf-dump.c (HANDLE_BOOTSTRAP_METHODS_ATTRIBUTE): New.
(HANDLE_END_BOOTSTRAP_METHODS): New.
(print_constant): Handlers for MethodHandle, MethodType, and
InvokeDynamic.
Richard Guenther [Wed, 11 Apr 2012 08:12:33 +0000 (08:12 +0000)]
re PR tree-optimization/52912 (ICE: verify_ssa failed)
2012-04-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52912
* tree-ssa-threadupdate.c (thread_block): Tell the cfg
manipulation code we are threading through a loop header
to an exit destination.