Richard Biener [Fri, 17 Jan 2014 14:49:18 +0000 (14:49 +0000)]
re PR tree-optimization/46590 (long compile time with -O2 and many loops)
2014-01-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/46590
* opts.c (default_options_table): Add entries for
OPT_fbranch_count_reg, OPT_fmove_loop_invariants and OPT_ftree_pta,
all enabled at -O1 but not for -Og.
* common.opt (fbranch-count-reg): Remove Init(1).
(fmove-loop-invariants): Likewise.
(ftree-pta): Likewise.
Jakub Jelinek [Fri, 17 Jan 2014 14:45:34 +0000 (15:45 +0100)]
i386.c (ix86_data_alignment): For compatibility with (incorrect) GCC 4.8 and earlier alignment assumptions...
* config/i386/i386.c (ix86_data_alignment): For compatibility with
(incorrect) GCC 4.8 and earlier alignment assumptions ensure we align
decls to at least the GCC 4.8 used alignments.
Jakub Jelinek [Fri, 17 Jan 2014 14:43:37 +0000 (15:43 +0100)]
re PR testsuite/58776 (gcc.dg/tree-ssa/gen-vect-32.c scan-tree-dump-times vect "vectorized 1 loops" 1)
PR testsuite/58776
* gcc.dg/tree-ssa-gen-vect-32.c: Add -fno-vect-cost-model to
dg-options, use dg-additional-options for i?86/x86_64 to avoid
option duplication.
Richard Biener [Fri, 17 Jan 2014 14:40:11 +0000 (14:40 +0000)]
re PR tree-optimization/46590 (long compile time with -O2 and many loops)
2014-01-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/46590
* vec.h (vec<>::bseach): New member function implementing
binary search according to C89 bsearch.
(vec<>::qsort): Avoid calling ::qsort for vectors with sizes 0 or 1.
* tree-ssa-loop-im.c (struct mem_ref): Make stored member a
bitmap pointer again. Make accesses_in_loop a flat array.
(mem_ref_obstack): New global.
(outermost_indep_loop): Adjust for mem_ref->stored changes.
(mark_ref_stored): Likewise.
(ref_indep_loop_p_2): Likewise.
(set_ref_stored_in_loop): New helper function.
(mem_ref_alloc): Allocate mem_refs on the mem_ref_obstack obstack.
(memref_free): Adjust.
(record_mem_ref_loc): Simplify.
(gather_mem_refs_stmt): Adjust.
(sort_locs_in_loop_postorder_cmp): New function.
(analyze_memory_references): Sort accesses_in_loop after
loop postorder number.
(find_ref_loc_in_loop_cmp): New function.
(for_all_locs_in_loop): Find relevant cluster of locs in
accesses_in_loop and iterate without recursion.
(execute_sm): Avoid uninit warning.
(struct ref_always_accessed): Simplify.
(ref_always_accessed::operator ()): Likewise.
(ref_always_accessed_p): Likewise.
(tree_ssa_lim_initialize): Initialize mem_ref_obstack, compute
loop postorder numbers here.
(tree_ssa_lim_finalize): Free mem_ref_obstack and loop postorder
numbers.
Nick Clifton [Fri, 17 Jan 2014 11:35:46 +0000 (11:35 +0000)]
msp430.opt: (mcpu): New option.
* config/msp430/msp430.opt: (mcpu): New option.
* config/msp430/msp430.c (msp430_mcu_name): Use target_mcu.
(msp430_option_override): Parse target_cpu. If the MCU name
matches a generic string, clear target_mcu.
(msp430_attr): Allow numeric interrupt values up to 63.
(msp430_expand_epilogue): No longer invert operand 1 of gen_popm.
* config/msp430/msp430.h (ASM_SPEC): Convert -mcpu into a -mmcu
option.
* config/msp430/t-msp430: (MULTILIB_MATCHES): Remove mcu matches.
Add mcpu matches.
* config/msp430/msp430.md (popm): Use %J rather than %I.
(addsi3): Use msp430_nonimmediate_operand for operand 2.
(addhi_cy_i): Use immediate_operand for operand 2.
* doc/invoke.texi: Document -mcpu option.
Richard Biener [Fri, 17 Jan 2014 10:47:59 +0000 (10:47 +0000)]
re PR rtl-optimization/38518 (Excessive compile time with -O3)
2014-01-17 Richard Biener <rguenther@suse.de>
PR rtl-optimization/38518
* df.h (df_analyze_loop): Declare.
* df-core.c: Include cfgloop.h.
(df_analyze_1): Split out main part of df_analyze.
(df_analyze): Adjust.
(loop_inverted_post_order_compute): New function.
(loop_post_order_compute): Likewise.
(df_analyze_loop): New function avoiding whole-function
postorder computes.
* loop-invariant.c (find_defs): Use df_analyze_loop.
(find_invariants): Adjust.
* loop-iv.c (iv_analysis_loop_init): Use df_analyze_loop.
Tim Shen [Thu, 16 Jan 2014 23:35:21 +0000 (23:35 +0000)]
regex_automaton.tcc (_StateSeq<>::_M_clone()): Do not use std::map.
2014-01-17 Tim Shen <timshen91@gmail.com>
* include/bits/regex_automaton.tcc (_StateSeq<>::_M_clone()): Do not
use std::map.
* include/bits/regex_automaton.h: Do not use std::set.
* include/bits/regex_compiler.h (_BracketMatcher<>::_M_add_char(),
_BracketMatcher<>::_M_add_collating_element(),
_BracketMatcher<>::_M_add_equivalence_class(),
_BracketMatcher<>::_M_make_range()): Likewise.
* include/bits/regex_compiler.tcc (_BracketMatcher<>::_M_apply()):
Likewise.
* include/bits/regex_executor.h: Do not use std::queue.
* include/bits/regex_executor.tcc (_Executor<>::_M_main(),
_Executor<>::_M_dfs()): Likewise.
* include/std/regex: Remove <map>, <set> and <queue>.
2014-01-17 Tim Shen <timshen91@gmail.com>
* include/bits/regex.h (__compile_nfa<>(), basic_regex<>::basic_regex(),
basic_regex<>::assign()): Change __compile_nfa to accept
const _CharT* only.
* include/bits/regex_compiler.h: Change _Compiler's template
argument from <_FwdIter, _TraitsT> to <_TraitsT>.
* include/bits/regex_compiler.tcc: Likewise.
2014-01-17 Tim Shen <timshen91@gmail.com>
* include/bits/regex_compiler.h: Change _ScannerT into char-type
templated.
* include/bits/regex_scanner.h (_Scanner<>::_Scanner()): Separate
_ScannerBase from _Scanner; Change _Scanner's template argument from
_FwdIter to _CharT. Avoid use of std::map and std::set by using arrays
instead.
* include/bits/regex_scanner.tcc (_Scanner<>::_Scanner(),
_Scanner<>::_M_scan_normal(), _Scanner<>::_M_eat_escape_ecma(),
_Scanner<>::_M_eat_escape_posix(), _Scanner<>::_M_eat_escape_awk()):
Likewise.
* include/std/regex: Add <cstring> for using strchr.
2014-01-17 Tim Shen <timshen91@gmail.com>
* bits/regex_automaton.tcc: Indentation fix.
* bits/regex_compiler.h (__compile_nfa<>(), _Compiler<>,
_RegexTranslator<> _AnyMatcher<>, _CharMatcher<>,
_BracketMatcher<>): Add bool option template parameters and
specializations to make matching more efficient and space saving.
* bits/regex_compiler.tcc: Likewise.
Bernd Schmidt [Thu, 16 Jan 2014 20:51:24 +0000 (20:51 +0000)]
014-01-16 Bernd Schmidt <bernds@codesourcery.com>
PR middle-end/56791
* reload.c (find_reloads_address_1): Do not use RELOAD_OTHER
* when
pushing a reload for an autoinc when we had previously reloaded an
inner part of the address.
* tree-vectorizer.h (struct _loop_vec_info): Add no_data_dependencies
field.
(LOOP_VINFO_NO_DATA_DEPENDENCIES): Define.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Clear it
when not giving up or versioning for alias only because of
loop->safelen.
(vect_analyze_data_ref_dependences): Set to true.
* tree-vect-stmts.c (hoist_defs_of_uses): Return false if def_stmt
is a GIMPLE_PHI.
(vectorizable_load): Use LOOP_VINFO_NO_DATA_DEPENDENCIES instead of
LOOP_REQUIRES_VERSIONING_FOR_ALIAS, add && !nested_in_vect_loop
to the condition.
Richard Earnshaw [Thu, 16 Jan 2014 17:35:50 +0000 (17:35 +0000)]
re PR target/59780 (ICE in aarch64_split_128bit_move)
PR target/59780
* aarch64.c (aarch64_split_128bit_move): Don't lookup REGNO on
non-register objects. Use gen_(high/low)part more consistently.
Fix assertions.
Nick Clifton [Thu, 16 Jan 2014 12:17:48 +0000 (12:17 +0000)]
re PR middle-end/28865 (Structures with a flexible arrray member have wrong .size)
PR middle-end/28865
* varasm.c (output_constant): Return the number of bytes actually
emitted.
(output_constructor_array_range): Update the field size with the
number of bytes emitted by output_constant.
(output_constructor_regular_field): Likewise. Also do not
complain if the total number of bytes emitted is now greater
than the expected fieldpos.
* output.h (output_constant): Update prototype and descriptive
comment.
Bill Schmidt [Wed, 15 Jan 2014 19:16:53 +0000 (19:16 +0000)]
altivec.md (mulv8hi3): Explicitly generate vmulesh and vmulosh rather than call gen_vec_widen_smult_*.
gcc:
2014-01-15 Bill Schmidt <wschmidt@vnet.linux.ibm.com>
* config/rs6000/altivec.md (mulv8hi3): Explicitly generate vmulesh
and vmulosh rather than call gen_vec_widen_smult_*.
(vec_widen_umult_even_v16qi): Test VECTOR_ELT_ORDER_BIG rather
than BYTES_BIG_ENDIAN to determine use of even or odd instruction.
(vec_widen_smult_even_v16qi): Likewise.
(vec_widen_umult_even_v8hi): Likewise.
(vec_widen_smult_even_v8hi): Likewise.
(vec_widen_umult_odd_v16qi): Likewise.
(vec_widen_smult_odd_v16qi): Likewise.
(vec_widen_umult_odd_v8hi): Likewise.
(vec_widen_smult_odd_v8hi): Likewise.
(vec_widen_umult_hi_v16qi): Explicitly generate vmuleub and
vmuloub rather than call gen_vec_widen_umult_*.
(vec_widen_umult_lo_v16qi): Likewise.
(vec_widen_smult_hi_v16qi): Explicitly generate vmulesb and
vmulosb rather than call gen_vec_widen_smult_*.
(vec_widen_smult_lo_v16qi): Likewise.
(vec_widen_umult_hi_v8hi): Explicitly generate vmuleuh and vmulouh
rather than call gen_vec_widen_umult_*.
(vec_widen_umult_lo_v8hi): Likewise.
(vec_widen_smult_hi_v8hi): Explicitly gnerate vmulesh and vmulosh
rather than call gen_vec_widen_smult_*.
(vec_widen_smult_lo_v8hi): Likewise.
gcc/testsuite:
2014-01-15 Bill Schmidt <wschmidt@vnet.linux.ibm.com>
Jason Merrill [Wed, 15 Jan 2014 19:10:09 +0000 (14:10 -0500)]
re PR c++/59659 (large zero-initialized std::array compile time excessive)
PR c++/59659
* typeck2.c (massage_init_elt): New.
(process_init_constructor_record)
(process_init_constructor_union): Use it.
(process_init_constructor_array): Use it. Use RANGE_EXPR.
(split_nonconstant_init_1): Handle it.
* semantics.c (cxx_eval_vec_init_1): Use force_rvalue.
Jeff Law [Wed, 15 Jan 2014 18:13:52 +0000 (11:13 -0700)]
re PR tree-optimization/59747 (wrong code at -Os and above on x86_64-linux-gnu in 64-bit mode)
PR tree-optimization/59747
* ree.c (find_and_remove_re): Properly handle case where a second
eliminated extension requires widening a copy created for elimination
of a prior extension.
(combine_set_extension): Ensure that the number of hard regs needed
for a destination register does not change when we widen it.
PR tree-optimization/59747
* gcc.c-torture/execute/pr59747.c: New test.
François Dumont [Wed, 15 Jan 2014 16:53:02 +0000 (16:53 +0000)]
hashtable_policy.h: Fix some long lines.
2014-01-15 François Dumont <fdumont@gcc.gnu.org>
* include/bits/hashtable_policy.h: Fix some long lines.
* include/bits/hashtable.h (__hash_code_base_access): Define and
use it to check its _M_bucket_index noexcept qualification. Use
also in place of...
(__access_protected_ctor): ...this.
* testsuite/23_containers/unordered_set/instantiation_neg.cc:
Adapt line number.
* testsuite/23_containers/unordered_set/
not_default_constructible_hash_neg.cc: Likewise.
Richard Biener [Wed, 15 Jan 2014 15:13:08 +0000 (15:13 +0000)]
re PR tree-optimization/59822 (ice in compute_live_loop_exits with -O3)
2014-01-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/59822
* tree-vect-stmts.c (hoist_defs_of_uses): New function.
(vectorizable_load): Use it to hoist defs of uses of invariant
loads out of the loop.
Jakub Jelinek [Wed, 15 Jan 2014 08:03:53 +0000 (09:03 +0100)]
re PR c/58943 (wrong calculation of indirect structure member arithmetic via function call)
PR c/58943
* c-typeck.c (build_modify_expr): For lhs op= rhs, if rhs has side
effects, preevaluate rhs using SAVE_EXPR first.
* c-omp.c (c_finish_omp_atomic): Set in_late_binary_op around
build_modify_expr with non-NOP_EXPR opcode. Handle return from it
being COMPOUND_EXPR.
(c_finish_omp_for): Handle incr being COMPOUND_EXPR with first
operand a SAVE_EXPR and second MODIFY_EXPR.
* gcc.c-torture/execute/pr58943.c: New test.
* gcc.dg/tree-ssa/ssa-fre-33.c (main): Avoid using += in the test.
H.J. Lu [Tue, 14 Jan 2014 16:41:10 +0000 (08:41 -0800)]
Consolidate ABI warning into type_natural_mode
gcc/
PR target/59794
* config/i386/i386.c (type_natural_mode): Add a bool parameter
to indicate if type is used for function return value. Warn
ABI change if the vector mode isn't available for function
return value.
(ix86_function_arg_advance): Pass false to type_natural_mode.
(ix86_function_arg): Likewise.
(ix86_gimplify_va_arg): Likewise.
(function_arg_32): Don't warn ABI change.
(ix86_function_value): Pass true to type_natural_mode.
(ix86_return_in_memory): Likewise.
(ix86_struct_value_rtx): Removed.
(TARGET_STRUCT_VALUE_RTX): Likewise.
gcc/testsuite/
PR target/59794
* g++.dg/ext/vector23.C: Also prune ABI change for Linux/x86.
* gcc.target/i386/pr39162.c (y): New __m256i variable.
(bar): Change return type to void. Set y to x.
* gcc.target/i386/pr59794-1.c: New testcase.
* gcc.target/i386/pr59794-2.c: Likewise.
* gcc.target/i386/pr59794-3.c: Likewise.
* gcc.target/i386/pr59794-4.c: Likewise.
* gcc.target/i386/pr59794-5.c: Likewise.
* gcc.target/i386/pr59794-6.c: Likewise.
* gcc.target/i386/pr59794-7.c: Likewise.
Jakub Jelinek [Tue, 14 Jan 2014 09:00:30 +0000 (10:00 +0100)]
re PR testsuite/59494 (FAIL: gfortran.dg/vect/fast-math-mgrid-resid.f scan-tree-dump-times optimized "vect_[^\\n]*\\+ " 13)
PR testsuite/59494
* gfortran.dg/vect/fast-math-mgrid-resid.f: Change
-fdump-tree-optimized to -fdump-tree-pcom-details in dg-options and
cleanup-tree-dump from optimized to pcom. Remove scan-tree-dump-times
for vect_\[^\\n\]*\\+, add scan-tree-dump-times for no suitable chains and
Executing predictive commoning without unrolling.
DJ Delorie [Mon, 13 Jan 2014 19:17:45 +0000 (14:17 -0500)]
msp430.md (call_internal): Don't allow memory references with SP as the base register.
* config/msp430/msp430.md (call_internal): Don't allow memory
references with SP as the base register.
(call_value_internal): Likewise.
* config/msp430/constraints.md (Yc): New. For memory references
that don't use SP as a base register.
* config/msp430/msp430.c (msp430_print_operand): Add 'J' to mean
"an integer without a # prefix"
* config/msp430/msp430.md (epilogue_helper): Use it.
Jakub Jelinek [Mon, 13 Jan 2014 19:16:30 +0000 (20:16 +0100)]
re PR tree-optimization/59617 ([vectorizer] ICE in vectorizable_mask_load_store with AVX-512F's gathers enabled.)
PR target/59617
* config/i386/i386.c (ix86_vectorize_builtin_gather): Uncomment
AVX512F gather builtins.
* tree-vect-stmts.c (vectorizable_mask_load_store): For now punt
on gather decls with INTEGER_TYPE masktype.
(vectorizable_load): For INTEGER_TYPE masktype, put the INTEGER_CST
directly into the builtin rather than hoisting it before loop.
Jakub Jelinek [Mon, 13 Jan 2014 19:14:03 +0000 (20:14 +0100)]
re PR tree-optimization/59387 (wrong code (hangs) at -Os on x86_64-linux-gnu)
PR tree-optimization/59387
* tree-scalar-evolution.c: Include gimple-fold.h and gimplify-me.h.
(scev_const_prop): If folded_casts and type has undefined overflow,
use force_gimple_operand instead of force_gimple_operand_gsi and
for each added stmt if it is assign with
arith_code_with_undefined_signed_overflow, call
rewrite_to_defined_overflow.
* tree-ssa-loop-im.c: Don't include gimplify-me.h, include
gimple-fold.h instead.
(arith_code_with_undefined_signed_overflow,
rewrite_to_defined_overflow): Moved to ...
* gimple-fold.c (arith_code_with_undefined_signed_overflow,
rewrite_to_defined_overflow): ... here. No longer static.
Include gimplify-me.h.
* gimple-fold.h (arith_code_with_undefined_signed_overflow,
rewrite_to_defined_overflow): New prototypes.
David Edelsohn [Sat, 11 Jan 2014 18:57:56 +0000 (18:57 +0000)]
re PR target/58115 (testcase gcc.target/i386/intrinsics_4.c failure)
PR target/58115
* config/rs6000/rs6000.h (SWITCHABLE_TARGET): Define.
* config/rs6000/rs6000.c: Include target-globals.h.
(rs6000_set_current_function): Instead of doing target_reinit
unconditionally, use save_target_globals_default_opts and
restore_target_globals.
* config/rs6000/rs6000-builtin.def (mffs, mtfsf): Add builtins for
FPSCR.
* config/rs6000/rs6000.c (rs6000_expand_mtfsf_builtin): New.
(rs6000_expand_builtin): Handle mffs and mtfsf.
(rs6000_init_builtins): Define mffs and mtfsf.
* config/rs6000/rs6000.md (UNSPECV_MFFS, UNSPECV_MTFSF): New.
(rs6000_mffs): New pattern.
(rs6000_mtfsf): New pattern.
Jerry DeLisle [Sat, 11 Jan 2014 18:57:20 +0000 (18:57 +0000)]
re PR fortran/59700 (Misleading/buggy runtime error message: Bad integer for item 0 in list input)
2014-01-11 Jerry DeLisle <jvdelisle@gcc.gnu>
Dominique d'Humieres <dominiq@lps.ens.fr>
Steven G. Kargl <kargl@gcc.gnu.org>
PR libfortran/59700
PR libfortran/59764
* io/io.h (struct st_parameter_dt): Assign expanded_read flag to
unused bit. Define new variable line_buffer_pos.
* io/list_read.c (free_saved, next_char, l_push_char,
read_logical, read_real): Replace use of item_count with
line_buffer_pos for line_buffer look ahead.
(read_logical, read_integer, parse_real, read_real, check_type):
Adjust location of free_line to after generating error messages
to retain the correct item count for the message.
Co-Authored-By: Dominique d'Humieres <dominiq@lps.ens.fr> Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
From-SVN: r206553
Bin Cheng [Sat, 11 Jan 2014 09:33:39 +0000 (09:33 +0000)]
tree-ssa-loop-ivopts.c (iv_ca_narrow): New parameter.
* tree-ssa-loop-ivopts.c (iv_ca_narrow): New parameter.
Start narrowing with START. Apply candidate-use pair
and check overall cost in narrowing.
(iv_ca_prune): Pass new argument.
Jeff Law [Fri, 10 Jan 2014 22:13:18 +0000 (15:13 -0700)]
re PR middle-end/59743 (ICE: Segmentation fault)
PR middle-end/59743
* ree.c (combine_reaching_defs): Ensure the defining statement
occurs before the extension when optimizing extensions with
different source and destination hard registers.
PR middle-end/59743
* gcc.c-torture/compile/pr59743.c: New test.