2019-04-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90166
* decl.c (in_module_or_interface): New function to check that the
current state is in a module, submodule, or interface.
(gfc_match_prefix): Use it.
2019-04-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/90166
* gfortran.dg/submodule_22.f08: Add additional dg-error comments.
From-SVN: r270495
With this testcase the code in template_args_equal to treat aliases as
distinct wasn't sufficient, because it only looked at the top level, whereas
here we have a reference to the alias. So let's also handle treating them
as distinct in structural_comptypes. For GCC 10 I have a more comprehensive
patch, but for GCC 9 let's go with this smaller change.
* typeck.c (structural_comptypes): When comparing_specializations,
aliases are unequal.
(comptypes): When comparing_specializations, do structural
comparison.
From-SVN: r270494
Fixes endian bugs in std.uni, and corrects unit-tests that failed on
version(BigEndian) targets.
Initial patch by Robin Dapp.
Reviewed-on: https://github.com/dlang/phobos/pull/6975
From-SVN: r270491
2019-04-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57284
* resolve.c (find_array_spec): If this is a class expression
and the symbol and component array specs are the same, this is
not an error.
*trans-intrinsic.c (gfc_conv_intrinsic_size): If a class symbol
argument, has no namespace, it has come from the interface
mapping and the _data component must be accessed directly.
2019-04-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57284
* gfortran.dg/class_70.f03
From-SVN: r270489
PR d/90130
d/dmd: Merge upstream dmd 065fbd452
Fixes endian bug in CTFE, and corrects tests in the D2 testsuite that
failed on big endian targets.
Initial patch by Robin Dapp.
Reviewed-on: https://github.com/dlang/dmd/pull/9665
From-SVN: r270485
Useless move insn removal was added to LRA just to avoid wasting CPU
cycles on such insn processing afterwards. Such insns are removed
anyway later in the pass pipeline. The CPU time savings are tiny but
the removal creates too many problems including PR target/90178.
Vladimir pre-approved the patch to remove the code:
https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00834.html
gcc/
PR target/90178
Revert:
2018-11-21 Uros Bizjak <ubizjak@gmail.com>
Revert the revert:
2013-10-26 Vladimir Makarov <vmakarov@redhat.com>
Revert:
2013-10-25 Vladimir Makarov <vmakarov@redhat.com>
* lra-spills.c (lra_final_code_change): Remove useless move insns.
gcc/testsuite/
PR target/90178
* gcc.target/i386/pr90178.c: New test.
From-SVN: r270484
PR d/90064
libphobos: Merge upstream phobos 428460ddd
Defines growDownwards on SPARC64, initial patch by Rainer Orth.
Backports another fix to std.process, allowing permissions tests to be
skipped when running as root.
Reviewed-on: https://github.com/dlang/phobos/pull/6962
From-SVN: r270483
Adds version (BacktraceExternal) for using libexecinfo instead of
internal implementation on FreeBSD, NetBSD, and DragonFly.
Reviewed-on: https://github.com/dlang/druntime/pull/2560
From-SVN: r270482
The current implementation of “speculation_barrier”
and “group_end_nop” insns emit hard-wired register
names which causes tests using them to fail on Darwin,
at least, which uses “rNN” instead of “NN”.
The patch makes the register names for these insns use
the operand output mechanism to substitute the
appropriate variant when needed.
gcc/
2019-04-21 Iain Sandoe <iain@sandoe.co.uk>
* config/rs6000/rs6000.md (group_end_nop): Emit insn register
names using operand format, rather than hard-wired.
(speculation_barrier): Likewise.
From-SVN: r270480
These earlier Darwin versions have “FP_≈” inside a
comment in architecture/{ppc,i386}/math.h, which is
included by math.h which causes the tests to fail.
The intent of the tests (i.e. to ensure that the
library itself does not emit non-ascii) is covered
by other platforms, including later Darwin editions.
2019-04-21 Iain Sandoe <iain@sandoe.co.uk>
* testsuite/17_intro/headers/c++1998/charset.cc: Skip for Darwin8
to Darwin10.
* testsuite/17_intro/headers/c++2011/charset.cc: Likewise.
* testsuite/17_intro/headers/c++2014/charset.cc: Likewise.
* testsuite/17_intro/headers/c++2017/charset.cc: Likewise.
* testsuite/17_intro/headers/c++2020/charset.cc: Likewise.
From-SVN: r270479
This shouldn't happen during normal traversal of the AST provided from
the front-end, however as there are some cases where declarations need
to be visited out of order, such as what is being done in PR d/89017, it
then becomes necessary to guard against this.
gcc/d/ChangeLog:
2019-04-21 Iain Buclaw <ibuclaw@gdcproject.org>
* decl.cc (DeclVisitor::visit(Import)): Set semanticRun after
completion, guard against being called more than once.
(DeclVisitor::visit(StructDeclaration)): Likewise.
(DeclVisitor::visit(ClassDeclaration)): Likewise.
(DeclVisitor::visit(InterfaceDeclaration)): Likewise.
(DeclVisitor::visit(VarDeclaration)): Likewise.
(DeclVisitor::visit(TypeInfoDeclaration)): Likewise.
From-SVN: r270478
As any unittest functions registered against the testing module when
compiling with -fbuilding-libphobos-tests are ignored during the
generation of the ModuleInfo data.
gcc/d/ChangeLog:
2019-04-21 Iain Buclaw <ibuclaw@gdcproject.org>
* modules.cc (register_module_decl): Don't register unittests against
the ModuleInfo symbol for -fbuilding-libphobos-tests.
From-SVN: r270477
The passage quoted talks about an initializer list containing a single
expression, but a braced-init-list is not an expression.
* pt.c (do_class_deduction): Don't try the single element deduction
if the single element is also a braced list.
From-SVN: r270468
The problem here was that "second parm is size_t" is false for a destroying
sized delete. So let's introduce sized_deallocation_fn_p when that's what
we're asking, and reserve second_parm_is_size_t for the specific case of
warning about possible confusion with placement delete.
* call.c (sized_deallocation_fn_p): New. Use it instead of
second_parm_is_size_t in most cases.
(second_parm_is_size_t): Don't check for aligned.
From-SVN: r270467
* include/pstl/algorithm_impl.h
(__internal::__brick_equal): use "4 iterator" version of
std::equal().
(__internal::__brick_equal): use simd for random access
iterators on unsequenced execution policies.
(__internal::__pattern_equal): add "4 iterator" version
(__internal::__pattern_equal): dispatch to simd __brick_equal
for vector-only execution policies.
(__internal::__pattern_equal): dispatch to __parallel_or for
parallel execution policies.
* include/pstl/glue_algorithm_impl.h
(std::equal): dispatch to "4 iterator" version of
__internal::__pattern_equal().
From-SVN: r270463
If we don't HONOR_NANS we should not try to use any unordered
comparison results. Best case those will just be optimized away;
realistically, they ICE. For example, the rs6000 backend has some
code that specifically checks we never do this.
PR tree-optimization/88055
* tree-call-cdce.c (comparison_code_if_no_nans): New function.
(gen_one_condition): Use it if !HONOR_NANS.
From-SVN: r270460
PR middle-end/90139
* tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return
assign_temp instead of gen_reg_rtx.
* gcc.c-torture/compile/pr90139.c: New test.
From-SVN: r270457
PR c++/90138
* pt.c (process_template_parm): Set decl to pushdecl result. If
!is_non_type, also set parm to that.
* g++.dg/template/pr90138.C: New test.
From-SVN: r270456
2019-04-19 Christophe Lyon <christophe.lyon@linaro.org>
PR translation/90118
contrib/
* check-internal-format-escaping.py: Check that %< is not next to
a word.
gcc/
* config/aarch64/aarch64.c (aarch64_override_options_internal):
Add missing space before %<.
From-SVN: r270454
PR c++/90108
* c-decl.c (merge_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.
* decl.c (duplicate_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.
* c-c++-common/pr90108.c: New test.
From-SVN: r270453
The removed code ended up setting DECL_INITIAL to the INIT_EXPR returned by
split_nonconstant_init, which makes no sense. This code was added back in
1996, so any rationale is long lost.
* decl.c (cp_finish_decl): Don't set DECL_INITIAL of external vars.
From-SVN: r270445
When testing PR 85164, the baseline bootstrap-ubsan results had
a lot of failures from int_const_binop. This is because with the
new overflow handling we can sometimes do:
poly_res = res;
on an uninitialised res.
2019-04-18 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* fold-const.c (int_const_binop): Return early on failure.
From-SVN: r270443
Two fixes for UB when handling very large offsets. The calculation in
force_int_to_mode would have been correct if signed integers used modulo
arithmetic, so just switch to unsigned types. The calculation in
rtx_addr_can_trap_p_1 didn't handle overflow properly, so switch to
known_subrange_p instead (which is supposed to handle all cases).
2019-04-18 Richard Sandiford <richard.sandiford@arm.com>
gcc/
PR middle-end/85164
* combine.c (force_int_to_mode): Cast the argument rather than
the result of known_alignment.
* rtlanal.c (rtx_addr_can_trap_p_1): Use known_subrange_p.
gcc/testsuite/
PR middle-end/85164
* gcc.dg/pr85164-1.c, gcc.dg/pr85164-2.c: New tests.
From-SVN: r270442
2019-04-18 Richard Biener <rguenther@suse.de>
* tree.c (get_qualified_type): Put found type variants at the
head of the variant list.
From-SVN: r270437
fix PR89864
2019-04-18 Erik Schnetter <schnetter@gmail.com>
Jakub Jelinek <jakub@redhat.com>
Iain Sandoe <iain@sandoe.co.uk>
PR bootstrap/89864
* inclhack.def (darwin_ucred__Atomic): New, work around _Atomic keyword
use in headers included by C++.
* fixincl.x: Regenerated.
Co-Authored-By: Iain Sandoe <iain@sandoe.co.uk>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r270435
PR go/90110
compiler: use temporary to avoid early destruction
The code was passing a substr directly to strtol, and then checking
the *end value returned by strtol. But the substr could be destroyed
as soon as strtol returns, making the test of *end invalid.
Also fix an incorrect test of the string index rather than the value.
Fixes https://gcc.gnu.org/PR90110
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/172663
From-SVN: r270434
In order to make alias templates useful for SFINAE we instantiate them under
the prevailing 'complain' argument, so an error encountered while
instantiating during SFINAE context is silent. The problem in this PR comes
when we later look up the erroneous instantiation and don't give an error at
that point. Fixed by not adding an erroneous instantiation to the hash
table, so we instantiate it again when needed and get the error. This
required changes to a number of tests, which previously said "substitution
failed:" with no explanation of what the failure was; now we properly
explain.
* pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
hash table when we're in SFINAE context.
From-SVN: r270433