The current recipe in Type_guard_expression for creating a Bexpression
performs a type conversion at the Type level, but doesn't invoke
Backend::convert_expression to capture the conversion for the back
end. Add code to create a BE type conversion operation.
Reviewed-on: https://go-review.googlesource.com/50373
From-SVN: r250400
PR target/80846
* config/i386/i386.c (ix86_expand_vector_init_general): Handle
V2TImode and V4TImode.
(ix86_expand_vector_extract): Likewise.
* config/i386/sse.md (VMOVE): Enable V4TImode even for just
TARGET_AVX512F, instead of only for TARGET_AVX512BW.
(ssescalarmode): Handle V4TImode and V2TImode.
(VEC_EXTRACT_MODE): Add V4TImode and V2TImode.
(*vec_extractv2ti, *vec_extractv4ti): New insns.
(VEXTRACTI128_MODE): New mode iterator.
(splitter for *vec_extractv?ti first element): New.
(VEC_INIT_MODE): New mode iterator.
(vec_init<mode>): Consolidate 3 expanders into one using
VEC_INIT_MODE mode iterator.
* gcc.target/i386/avx-pr80846.c: New test.
* gcc.target/i386/avx2-pr80846.c: New test.
* gcc.target/i386/avx512f-pr80846.c: New test.
From-SVN: r250397
2017-07-20 Richard Biener <rguenther@suse.de>
* gimple.h (gimple_phi_result): Add gphi * overload.
(gimple_phi_result_ptr): Likewise.
(gimple_phi_arg): Likewise. Adjust index assert to only
allow actual argument accesses rather than all slots available
by capacity.
(gimple_phi_arg_def): Add gphi * overload.
* tree-phinodes.c (make_phi_node): Initialize only actual
arguments.
(resize_phi_node): Clear memory not covered by old node,
do not initialize excess argument slots.
(reserve_phi_args_for_new_edge): Initialize new argument slot
completely.
From-SVN: r250385
2017-07-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/61171
* tree-vectorizer.h (slp_instance): Add reduc_phis member.
(vect_analyze_stmt): Add slp instance parameter.
(vectorizable_reduction): Likewise.
* tree-vect-loop.c (vect_analyze_loop_operations): Adjust.
(vect_is_simple_reduction): Deal with chains not detected
as SLP reduction chain, specifically not properly associated
chains containing a mix of plus/minus.
(get_reduction_op): Remove.
(get_initial_defs_for_reduction): Simplify, pass in whether
this is a reduction chain, pass in the SLP node for the PHIs.
(vect_create_epilog_for_reduction): Get the SLP instance as
arg and adjust.
(vectorizable_reduction): Get the SLP instance as arg.
During analysis remember the SLP node with the PHIs in the
instance. Simplify getting at the vectorized reduction PHIs.
* tree-vect-slp.c (vect_slp_analyze_node_operations): Pass
through SLP instance.
(vect_slp_analyze_operations): Likewise.
* tree-vect-stms.c (vect_analyze_stmt): Likewise.
(vect_transform_stmt): Likewise.
* g++.dg/vect/pr61171.cc: New testcase.
* gfortran.dg/vect/pr61171.f: Likewise.
* gcc.dg/vect/vect-reduc-11.c: Likewise.
From-SVN: r250382
2017-07-20 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/81489
* gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior): Move
read of phi arg location to before loop that modifies phi.
From-SVN: r250378
PR libstdc++/81476
* include/bits/vector.tcc (vector::_M_range_insert<_InputIterator>):
Only insert elements one-by-one when inserting at the end.
* testsuite/performance/23_containers/insert/81476.cc: New.
From-SVN: r250366
We here have an AND of a SUBREG of an LSHIFTRT. If that SUBREG is
paradoxical, the extraction we form is the length of the size of the
inner mode, which includes some bits that should not be in the result.
Just give up in that case.
PR rtl-optimization/81423
* combine.c (make_compound_operation_int): Don't try to optimize
the AND of a SUBREG of an LSHIFTRT if that SUBREG is paradoxical.
From-SVN: r250365
2017-07-19 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/cpu-builtin-1.c: Change test to use #ifdef
__BUILTIN_CPU_SUPPORTS to see if the GLIBC is new enough that
__builtin_cpu_is and __builtin_cpu_supports are supported.
From-SVN: r250364
... if it is an IOR with a constant with all bits set in the mode
that is truncated to, for example. Handle that case.
PR rtl-optimization/81423
* simplify-rtx.c (simplify_truncation): Handle truncating an IOR
with a constant that is -1 in the truncated to mode.
From-SVN: r250363
Fix up plafform testes in check headers. After a resent GCC change
the previously submitted BMI/BMI2 intrinsic test started to fail
with a warning/error.
[gcc/testsuite]
2017-07-19 Steven Munroe <munroesj@gcc.gnu.org>
* gcc.target/powerpc/bmi-check.h (main): Skip unless
__BUILTIN_CPU_SUPPORTS__ defined.
* gcc.target/powerpc/bmi2-check.h (main): Skip unless
__BUILTIN_CPU_SUPPORTS__ defined.
From-SVN: r250362
* predict.c (propagate_unlikely_bbs_forward): Break out from ...
(determine_unlikely_bbs): ... here.
* predict.h (propagate_unlikely_bbs_forward): Declare.
* cfgexpand.c (pass_expand::execute): Use it.
* bb-reorder.c (sanitize_hot_paths): Do not consider known to be
unlikely edges.
(find_rarely_executed_basic_blocks_and_crossing_edges): Use
propagate_unlikely_bbs_forward.
From-SVN: r250360
* predict.c (propagate_unlikely_bbs_forward): Break out from ...
(determine_unlikely_bbs): ... here.
* predict.h (propagate_unlikely_bbs_forward): Declare.
* cfgexpand.c (pass_expand::execute): Use it.
* bb-reorder.c (sanitize_hot_paths): Do not consider known to be
unlikely edges.
(find_rarely_executed_basic_blocks_and_crossing_edges): Use
propagate_unlikely_bbs_forward.
From-SVN: r250359
* gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE,
TYPE_GCC_MIN_VALUE): Use TYPE_MIN_VALUE_RAW instead of TYPE_MINVAL.
(TYPE_GCC_MAX_VALUE): Use TYPE_MAX_VALUE_RAW instead of TYPE_MAXVAL.
From-SVN: r250355
2017-07-19 Tom de Vries <tom@codesourcery.com>
* config/nvptx/nvptx-modes.def: New file. Add V2SImode.
* config/nvptx/nvptx.c (nvptx_ptx_type_from_mode): Handle V2SImode.
(nvptx_vector_mode_supported): New function. Allow V2SImode.
(TARGET_VECTOR_MODE_SUPPORTED_P): Redefine to nvptx_vector_mode_supported.
* config/nvptx/nvptx.md (VECIM): New mode iterator. Add V2SI.
(mov<VECIM>_insn): New define_insn.
(define_expand "mov<VECIM>): New define_expand.
* gcc.target/nvptx/slp-run.c: New test.
* gcc.target/nvptx/slp.c: New test.
* gcc.target/nvptx/v2si-cvt.c: New test.
* gcc.target/nvptx/v2si-run.c: New test.
* gcc.target/nvptx/v2si.c: New test.
* gcc.target/nvptx/vec.inc: New test.
From-SVN: r250340
PR tree-optimization/81346
* fold-const.h (fold_div_compare, range_check_type): Declare.
* fold-const.c (range_check_type): New function.
(build_range_check): Use range_check_type.
(fold_div_compare): No longer static, rewritten into
a match.pd helper function.
(fold_comparison): Don't call fold_div_compare here.
* match.pd (X / C1 op C2): New optimization using fold_div_compare
as helper function.
* gcc.dg/tree-ssa/pr81346-1.c: New test.
* gcc.dg/tree-ssa/pr81346-2.c: New test.
* gcc.dg/tree-ssa/pr81346-3.c: New test.
* gcc.dg/tree-ssa/pr81346-4.c: New test.
* gcc.target/i386/umod-3.c: Hide comparison against 1 from the
compiler to avoid X / C1 op C2 optimization to trigger.
From-SVN: r250338
2017-07-19 Martin Liska <mliska@suse.cz>
PR sanitizer/63361
* c-c++-common/ubsan/float-cast-overflow-1.c: Add either
-ffloat-store or -mieee for targets that need it.
From-SVN: r250336
In Func_expression::do_get_backend when creating the backend
representation for a closure, create a backend type conversion to
account for potential differences between the closure struct type
(where the number of fields is dependent on the number of values
referenced in the closure) and the generic function descriptor type
(struct with single function pointer field).
Reviewed-on: https://go-review.googlesource.com/49255
From-SVN: r250327
PR go/81451
runtime: inline runtime_osinit
We had two identical copies of runtime_osinit. They set runtime_ncpu,
a variable that is no longer used. Removing that leaves us with two lines.
Inline those two lines in the two places the function was called.
This fixes GCC PR 81451.
Reviewed-on: https://go-review.googlesource.com/48862
From-SVN: r250326
The code in Named_type::do_get_backend was not passing the correct
flag value for circular function types to Backend::circular_pointer_type
(it was always setting this flag to false). Pass a true value if the
type being converted is a function type.
Reviewed-on: https://go-review.googlesource.com/49330
From-SVN: r250325