PR middle-end/84406
* optabs-query.c (find_widening_optab_handler_and_mode): If from_mode
is a scalar_int_mode, assert that to_mode is a scalar_int_mode with
greater precision. If to_mode is a MODE_PARTIAL_INT, stop the
search at the associated MODE_INT.
From-SVN: r257858
PR middle-end/82123
PR tree-optimization/81592
PR middle-end/79257
* gimple-ssa-sprintf.c (format_integer): Query EVRP range analyzer
for range data rather than using global data.
* gcc.dg/pr81592.c: New test.
* gcc.dg/pr82123.c: New test.
From-SVN: r257857
2018-02-20 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/48890
PR fortran/83823
* primary.c (gfc_convert_to_structure_constructor):
For a constant string constructor, make sure the length
is correct.
2018-02-20 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/48890
PR fortran/83823
* gfortran.dg/structure_constructor_14.f90: New test.
From-SVN: r257856
PR middle-end/82123
PR tree-optimization/81592
PR middle-end/79257
* gimple-ssa-sprintf.c (get_int_range): Query EVRP range analyzer for
range data rather than using global data.
From-SVN: r257855
PR middle-end/82123
PR tree-optimization/81592
PR middle-end/79257
* gimple-ssa-sprintf.c (sprintf_dom_walker::handle_gimple_call): Query
the EVRP range analyzer for range data rather than using global data.
From-SVN: r257853
PR middle-end/82123
PR tree-optimization/81592
PR middle-end/79257
* gimple-ssa-sprintf.c: Include alloc-pool.h, vr-values.h and
gimple-ssa-evrp-analyze.h
(class sprintf_dom_walker): Add after_dom_children member function.
Add evrp_range_analyzer member.
(sprintf_dom_walker::before_dom_children): Call into the EVRP
range analyzer as needed.
(sprintf_dom_walker::after_dom_children): New member function.
* gcc.dg/builtin-unreachable-6.c: Turn off VRP.
From-SVN: r257852
Let a fast syscall return be a preemption point. This helps with
tight loops that make system calls, as in BenchmarkSyscallExcessWork.
Reviewed-on: https://go-review.googlesource.com/94895
From-SVN: r257848
expand_call_mem_ref checks for TARGET_MEM_REFs that have compatible
type, but it didn't then go on to install the specific type we need,
which might have different alignment due to:
if (TYPE_ALIGN (type) != align)
type = build_aligned_type (type, align);
This was causing masked stores to be incorrectly marked as
aligned on AVX512.
2018-02-20 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR tree-optimization/84419
* internal-fn.c (expand_call_mem_ref): Create a TARGET_MEM_REF
with the required type if its current type is compatible but
different.
gcc/testsuite/
PR tree-optimization/84419
* gcc.dg/vect/pr84419.c: New test.
From-SVN: r257847
PR middle-end/82004
* match.pd (pow(C,x) -> exp(log(C)*x)): Delay all folding until
after vectorization.
* gfortran.dg/pr82004.f90: New test.
From-SVN: r257846
Aliases are supposed to be identical to the type being aliased, so
questions about type compatibility need to always ignore aliases,
except for error messages involving the type name.
The test case for this is https://golang.org/cl/94995.
Fixesgolang/go#23912
Reviewed-on: https://go-review.googlesource.com/94996
From-SVN: r257845
2018-02-20 Martin Liska <mliska@suse.cz>
PR driver/83193
* config/aarch64/aarch64.c (aarch64_print_hint_for_core_or_arch): Print
possible values if we don't have a hint.
From-SVN: r257844
The C++ frontend generates a break that results in the fallthrough
warning misfiring in nested switch blocks where cases in the inner
switch block return, rendering the break pointless. The fallthrough
detection in finish_break_stmt does not work either because the
condition is encoded as an IF_STMT and not a COND_EXPR.
Fix this by adding a condition for IF_STMT in the
langhooks.block_may_fallthru for C++. Fix tested on x86_64.
gcc/cp
* cp-objcp-common.c (cxx_block_may_fallthru): Add case for
IF_STMT.
gcc/testsuite
* g++.dg/nested-switch.C: New test case.
From-SVN: r257843
PR c++/84445
* class.c (fixed_type_or_null) <case CALL_EXPR>: Only test
TREE_HAS_CONSTRUCTOR if instance is not an internal function call.
* g++.dg/cpp1z/launder7.C: New test.
From-SVN: r257840
PR c++/84449
* tree.c (bot_manip): If build_cplus_new or break_out_target_exprs
returns error_mark_node, return it immediately.
(break_out_target_exprs): If cp_walk_tree with bot_manip returns
error_mark_node, return error_mark_node.
* g++.dg/cpp0x/constexpr-84449.C: New test.
From-SVN: r257839
PR c++/84455
* pt.c (tsubst_lambda_expr): If not nested, increment temporarily
function_depth to avoid GC during finish_lambda_function.
* g++.dg/cpp0x/lambda/lambda-ice26.C: New test.
From-SVN: r257838
2018-02-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83344
PR fortran/83975
* resolve.c (resolve_assoc_var): Rearrange the logic for the
determination of the character length of associate names. If
the associate name is missing a length expression or the length
expression is not a constant and the target is not a variable,
make the associate name allocatable and deferred length.
* trans-decl.c (gfc_get_symbol_decl): Null the character length
backend_decl for deferred length associate names that are not
variables. Set 'length' to gfc_index_zero_node for character
associate names, whose character length is a PARM_DECL.
2018-02-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83344
PR fortran/83975
* gfortran.dg/associate_22.f90: Enable commented out test.
* gfortran.dg/associate_36.f90: New test.
From-SVN: r257827
PR c++/84448
* parser.c (cp_parser_binary_expression): For no_toplevel_fold_p, if
either operand is error_mark_node, set current.lhs to that instead of
creating a binary op with error_mark_node operands.
* g++.dg/gomp/pr84448.C: New test.
From-SVN: r257821
2018-02-19 Martin Liska <mliska@suse.cz>
Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/82491
* gimple-fold.c (get_base_constructor): Make earlier bail out
to prevent ubsan.
Co-Authored-By: Richard Sandiford <richard.sandiford@linaro.org>
From-SVN: r257816
gcc/fortran/ChangeLog:
2018-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
* gfortran.texi: Document additional src/dst_type. Fix some typos.
* trans-decl.c (gfc_build_builtin_function_decls): Declare the new
argument of _caf_*_by_ref () with * e { get, send, sendget }.
* trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Add the type of the
data referenced when generating a call to caf_get_by_ref ().
(conv_caf_send): Same but for caf_send_by_ref () and
caf_sendget_by_ref ().
gcc/testsuite/ChangeLog:
2018-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
* gfortran.dg/coarray_alloc_comp_6.f08: New test.
* gfortran.dg/coarray_alloc_comp_7.f08: New test.
* gfortran.dg/coarray_alloc_comp_8.f08: New test.
libgfortran/ChangeLog:
2018-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
* caf/libcaf.h: Add type parameters to the caf_*_by_ref prototypes.
* caf/single.c (get_for_ref): Simplifications and now respecting
the type argument.
(_gfortran_caf_get_by_ref): Added source type handing to get_for_ref().
(send_by_ref): Simplifications and respecting the dst_type now.
(_gfortran_caf_send_by_ref): Added destination type hand over to
send_by_ref().
(_gfortran_caf_sendget_by_ref): Added general support and fixed stack
corruption. The function is now really usable.
From-SVN: r257813
gcc/ChangeLog:
2018-02-19 Carl Love <cel@us.ibm.com>
* config/rs6000/rs6000-builtin.def: Change NEG macro expansions from
BU_ALTIVEC_A to BU_P8V_AV_1 and BU_ALTIVEC_OVERLOAD_1 to
BU_P8V_OVERLOAD_1.
* config/rs6000/rs6000-c.c: Change ALTIVEC_BUILTIN_VEC_NEG to
P8V_BUILTIN_VEC_NEG.
gcc/testsuite/ChangeLog:
2018-02-19 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/fold-vec-neg-int.p7.c: Remove test file.
From-SVN: r257812
ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and
newer x86 processors, starting Pentium Pro. They are UD on older
32-bit processors. Detect this at configure time and adjust the
default value for enable_cet. GCC will enable CET in 32-bit run-time
libraries in any case if --enable-cet is used to configure GCC.
PR target/84148
* config/cet.m4: Check if target support multi-byte NOPS (SSE).
* libatomic/configure: Regenerate.
* libbacktrace/configure: Likewise.
* libgcc/configure: Likewise.
* libgfortran/configure: Likewise.
* libgomp/configure: Likewise.
* libitm/configure: Likewise.
* libmpx/configure: Likewise.
* libobjc/configure: Likewise.
* libquadmath/configure: Likewise.
* libsanitizer/configure: Likewise.
* libssp/configure: Likewise.
* libstdc++-v3/configure: Likewise.
* libvtv/configure: Likewise.
From-SVN: r257809
2018-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/84412
* io/transfer.c (finalize_transfer): After completng an internal unit
I/O operation, clear internal_unit_kind.
From-SVN: r257791
For e500 family cores we do some questionable things with those flags,
which does not work with LTO. So don't.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Don't
handle rs6000_single_float and rs6000_double_float specially for
e500 family CPUs.
From-SVN: r257790