PR target/89827
* config/i386/i386.c (dimode_scalar_chain::convert_reg):
Also process XEXP (src, 0) of a shift insn.
testsuite/ChangeLog:
PR target/89827
* gcc.target/i386/pr89827.c: New test.
From-SVN: r269953
When we refer to a captured variable from a constant-expression context
inside a lambda, the closure (like any function parameter) is not constant
because we aren't in a call, so we don't have an argument. So the capture
is non-constant. But if the captured variable is constant, we might be able
to use it directly in constexpr evaluation.
PR c++/82643
PR c++/87327
* constexpr.c (cxx_eval_constant_expression): In a lambda function,
try evaluating the captured variable directly.
From-SVN: r269951
The static assertions added for PR libstdc++/48101 were at class scope
and so were evaluated too eagerly, when it might not be possible to
determine whether the function objects are invocable with the key types.
The problematic cases are where the key type is not known to be
convertible to the argument type(s) of the function object until later,
after a type has been completed. Specifically, if the key type is a
pointer to a derived class and the function object's argument type is a
pointer to a base class, then the derived-to-base conversion is only
valid once the derived type is complete.
By moving the static assertions to the destructor they will only be
evaluated when the destructor is instantiated, at which point whether
the key type can be passed to the function object should be knowable.
The ideal place to do the checks would be only when the function objects
are actually invoked, but that would mean adding the checks in numerous
places, so the destructor is used instead.
The tests need to be adjusted because the "required from here" line is
now the location of the destructor, not the point of instantiation in
the test file. For the map and multimap tests which check two
specializations, the dg-error matching the assertion text matches both
cases. Also check the diagnostic output for the template arguments, to
ensure both specializations trigger the assertion.
PR libstdc++/85965
* include/bits/hashtable.h (_Hashtable): Move static assertions to
destructor so they are not evaluated until the _Key type is complete.
* include/bits/stl_tree.h (_Rb_tree): Likewise.
* testsuite/23_containers/set/85965.cc: New test.
* testsuite/23_containers/unordered_set/85965.cc: New test.
* testsuite/23_containers/map/48101_neg.cc: Replace "here" errors
with regexp matching the corresponding _Rb_tree specialization.
* testsuite/23_containers/multimap/48101_neg.cc: Likewise.
* testsuite/23_containers/multiset/48101_neg.cc: Remove "here" error.
* testsuite/23_containers/set/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_map/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_multimap/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_multiset/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_set/48101_neg.cc: Likewise.
From-SVN: r269949
PR libstdc++/89825
Fix based on a suggestion by Antony Polukhin.
* include/std/variant (_Extra_visit_slot_needed): New.
(_Multi_array): Use it.
(_S_apply_all_alts): Likewise.
From-SVN: r269947
Fixes memory leak in the front-end symbol mangler, and introduces
recognition and rejection of a few more C types and directives.
Reviewed-on: https://github.com/dlang/dmd/pull/9492
From-SVN: r269945
* hash-table.h (hash_table::m_gather_mem_stats): If GATHER_STATISTICS
is constant 0, turn into static const data member initialized to false.
(hash_table::hash_table): Only initialize m_gather_mem_stats #if
GATHER_STATISTICS. Add ATTRIBUTE_UNUSED to gather_mem_stats param.
From-SVN: r269944
PR libstdc++/89824
Fix based on a suggestion by Antony Polukhin.
* include/std/variant (__gen_vtable): Don't reserve an
additional table slot, _Multi_array already does that.
From-SVN: r269941
PR libstdc++/89816
Fix based on a suggestion by Antony Polukhin.
* include/std/variant (__variant_construct): Capture a pointer
to the storage and visit just one variant.
From-SVN: r269940
2019-03-26 Bin Cheng <bin.cheng@linux.alibaba.com>
PR tree-optimization/81740
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence):
In case of outer loop vectorization, check for backward dependence
at the inner loop if outer loop dependence is reversed.
* gcc.dg/vect/pr81740-1.c: New testcase.
* gcc.dg/vect/pr81740-2.c: Likewise.
From-SVN: r269938
PR rtl-optimization/88347
PR rtl-optimization/88423
* sched-deps.c (sched_analyze_insn): Take into account that for
tablejumps the barrier appears after a label and a jump_table_data.
* gcc.c-torture/compile/pr88347.c: New test.
* gcc.c-torture/compile/pr88423.c: New test.
From-SVN: r269928
gcc/c-family/ChangeLog:
PR c/89812
* c-common.c (check_user_alignment): Rename local. Correct maximum
alignment in diagnostic. Avoid assuming argument fits in SHWI,
convert it to UHWI when it fits.
gcc/testsuite/ChangeLog:
PR c/89812
* gcc.dg/attr-aligned-3.c: New test.
From-SVN: r269927
PR debug/86964
* dwarf2out.c (premark_used_variables): New function.
(prune_unused_types_walk): Do not mark not premarked external
variables.
(prune_unused_types): Call premark_used_variables.
* gcc.dg/debug/dwarf2/pr86964.c: New testcase.
From-SVN: r269925
2019-03-25 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/89676
* lra-constraints.c (curr_insn_transform): Do match reload for
early clobbers when the match was successful only for different
registers.
From-SVN: r269924
This issue is similar to PR 87480; in both cases we were doing non-dependent
substitution with processing_template_decl set, leading to member access
expressions seeming still instantiation-dependent, and therefore decltype
not being simplified to its actual type. And as in that PR, the fix is to
clear processing_template_decl while substituting a default template
argument.
* pt.c (most_specialized_partial_spec): Clear
processing_template_decl.
From-SVN: r269921
gcc/ChangeLog:
* doc/extend.texi (Common Type Attributes): Document vector_size.
(Common Variable Attributes): Mention size constraint. Correct
quoting and typos.
(Vector Extensions): Use @dfn when defining bas type. Clarify
base type and size constraints.
From-SVN: r269920
* typeck2.c (digest_init_r): Warn about object slicing instead of
crashing.
* g++.dg/cpp1z/aggr-base8.C: New test.
* g++.dg/cpp1z/aggr-base9.C: New test.
From-SVN: r269919
* call.c (reference_binding): If the result of the conversion function
is a prvalue of non-class type, use the cv-unqualified type.
* g++.dg/cpp0x/rv-conv2.C: New test.
From-SVN: r269918
2019-03-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/89789
* tree-ssa-sccvn.c (set_ssa_val_to): Do not allow lattice
changes from non-undefined back to undefined.
* gcc.dg/torture/pr89789.c: New testcase.
From-SVN: r269917
2019-03-25 Thomas Otto <thomas.otto@pdv-fs.de>
* dwarf2out.c (comp_dir_string): cached_wd could be set to both a
heap string and a gc string, but since this variable is unknown to
ggc the gc string might get reused and corrupted. Fixed by always
using a heap string.
From-SVN: r269916
2019-03-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/89779
* tree-ssa-loop-ivopts.c (remove_unused_ivs): Return
to remove IV defs, delay actual removal.
(tree_ssa_iv_optimize_loop): Likewise. Avoid SCEV reset.
(tree_ssa_iv_optimize): Remove eliminated IV defs at the
very end, properly also reset loop control IV information.
From-SVN: r269914
gcc/ChangeLog:
2019-03-25 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390-builtin-types.def: Remove few unused types and
fix sort order for others.
From-SVN: r269909
gcc/ChangeLog:
2019-03-25 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390-c.c (s390_fn_types_compatible): Print the
expected and found types with -mdebug during builtin matching.
From-SVN: r269908
I think there's a typo in the documentation of the MINLOC and MAXLOC intrinsics.
It implies that when the BACK argument is true it returns the first occurrence of the min/max value,
but my understanding is that it should return the last occurrence.
This patch fixes the documentation.
* intrinsic.texi (MINLOC): Fix typo in BACK argument documentation.
(MAXLOC): Likewise.
From-SVN: r269906
CSE does not consider calls, not even const calls. This patch puts a
REG_EQUAL note on the pseudo we assign the __tls_get_addr result to,
so that those pseudos can be CSE'd and the extra calls deleted as dead
code.
CSE should really handle const calls directly, but it is stage 4.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Add REG_EQUAL
notes for the result of the __tls_get_addr calls.
* config/rs6000/rs6000.md (unspec UNSPEC_TLS_GET_ADDR): New.
From-SVN: r269902
Introduces a fix for a segfault when building without object.d being
present, as well as MinGW host build errors in dmd/root/filename.c.
Updates a couple of non-portable tests, removing one and fixing the
other.
From-SVN: r269897
PR rtl-optimization/87761
* regcprop.c (copyprop_hardreg_forward_1): Check may_trap_p on SET,
not INSN. Also check RTX_FRAME_RELATED_P. Queue insns for DF rescan
as needed.
(pass_cprop_hardreg::execute): Add df note problem and defer insn
rescans. Reprocess blocks as needed, calling df_analyze before
reprocessing. Always call df_analyze before fixing up debug bind
insns.
From-SVN: r269896