Earlier changes to defer instantiating a defaulted noexcept-specifier that
depends on yet-unparsed default member initializers broke this testcase,
where instantiation fails for another reason. In this case there's no
reason to defer and try again later, so let's not.
* pt.c (maybe_instantiate_noexcept): Only return false if defaulted.
(regenerate_decl_from_template): Use it for noexcept-specs.
From-SVN: r269746
PR fortran/89724
* scanner.c (load_line): Remove linenum and current_line static
variables, add warned_tabs automatic variable. Use current_file->line
instead of current_line and warned_tabs boolean to avoid diagnosing
tabs multiple times on the same line.
* gfortran.dg/continuation_15.f90: New test.
* gfortran.dg/continuation_16.f90: New test.
From-SVN: r269734
2019-03-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84394
* symbol.c (gfc_add_subroutine): If we are encountering a
subrtoutine within a BLOCK DATA and the name starts with an
underscore, do not check.
2019-03-16 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84394
* gfortran.dg/blockdata_11.f90: New test.
From-SVN: r269721
PR89721 shows LRA treating an unspec_volatile's result as invariant,
which of course isn't correct. This patch fixes it.
PR rtl-optimization/89721
* lra-constraints (invariant_p): Return false if side_effects_p holds.
From-SVN: r269716
gcc/ChangeLog:
2019-03-15 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/87532
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
When handling vec_extract, use modular arithmetic to allow
constant selectors greater than vector length.
* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Allow
V1TImode vectors to have constant selector values greater than 0.
Use modular arithmetic to compute vector index.
(rs6000_split_vec_extract_var): Use modular arithmetic to compute
index for in-memory vectors. Correct code generation for
in-register vectors.
(altivec_expand_vec_ext_builtin): Use modular arithmetic to
compute index.
gcc/testsuite/ChangeLog:
2019-03-15 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/87532
* gcc.target/powerpc/fold-vec-extract-char.p8.c: Modify expected
instruction selection.
* gcc.target/powerpc/fold-vec-extract-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p8.c: Likewise.
* gcc.target/powerpc/pr87532-mc.c: New test.
* gcc.target/powerpc/pr87532.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2.h: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2a.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2b.c: New test.
* gcc.target/powerpc/vsx-builtin-10a.c: New test.
* gcc.target/powerpc/vsx-builtin-10b.c: New test.
* gcc.target/powerpc/vsx-builtin-11a.c: New test.
* gcc.target/powerpc/vsx-builtin-11b.c: New test.
* gcc.target/powerpc/vsx-builtin-12a.c: New test.
* gcc.target/powerpc/vsx-builtin-12b.c: New test.
* gcc.target/powerpc/vsx-builtin-13a.c: New test.
* gcc.target/powerpc/vsx-builtin-13b.c: New test.
* gcc.target/powerpc/vsx-builtin-14a.c: New test.
* gcc.target/powerpc/vsx-builtin-14b.c: New test.
* gcc.target/powerpc/vsx-builtin-15a.c: New test.
* gcc.target/powerpc/vsx-builtin-15b.c: New test.
* gcc.target/powerpc/vsx-builtin-16a.c: New test.
* gcc.target/powerpc/vsx-builtin-16b.c: New test.
* gcc.target/powerpc/vsx-builtin-17a.c: New test.
* gcc.target/powerpc/vsx-builtin-17b.c: New test.
* gcc.target/powerpc/vsx-builtin-18a.c: New test.
* gcc.target/powerpc/vsx-builtin-18b.c: New test.
* gcc.target/powerpc/vsx-builtin-19a.c: New test.
* gcc.target/powerpc/vsx-builtin-19b.c: New test.
* gcc.target/powerpc/vsx-builtin-20a.c: New test.
* gcc.target/powerpc/vsx-builtin-20b.c: New test.
* gcc.target/powerpc/vsx-builtin-9a.c: New test.
* gcc.target/powerpc/vsx-builtin-9b.c: New test.
From-SVN: r269715
P0732R2 / C++ 2a introduce class literals as template parameters. The
front-end uses VAR_DECLs constructed from such literals to bind the
template PARM_DECLs, but dwarf2out.c used to reject such VAR_DECLs.
Taking DECL_INITIAL from such VAR_DECLs enables the generation of
DW_AT_const_value for them, at least when the class literal can
actually be represented as such.
for gcc/ChangeLog
PR c++/88534
PR c++/88537
* dwarf2out.c (generic_parameter_die): Follow DECL_INITIAL of
VAR_DECL args.
for gcc/testsuite/ChangeLog
PR c++/88534
PR c++/88537
* g++.dg/cpp2a/pr88534.C: New.
* g++.dg/cpp2a/pr88537.C: New.
From-SVN: r269709
PR d/88990
d/dmd: Merge upstream dmd 8d4c876c6
The extern storage class flag was wrongly propagated to function scope
when starting the semantic pass on the body.
Fixes https://gcc.gnu.org/PR88990
Reviewed-on: https://github.com/dlang/dmd/pull/9452
From-SVN: r269708
As of recently the -march,-mcpu,-mtune strings in the error messages are
now quoted.
This patch adjusts the testcases in gcc.target/aarch64/ that had started
failing due to that change.
PR target/89719
* gcc.target/aarch64/spellcheck_4.c: Adjust dg-error string.
* gcc.target/aarch64/spellcheck_5.c: Likewise.
* gcc.target/aarch64/spellcheck_6.c: Likewise.
From-SVN: r269703
The compiler generates two array index expressions when lowering
an append expression. Currently they generate bound checks.
Bound checks are not necessary in this case, as we know the slice
has, or will grow to, enough length and capacity. Eliminate them.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166817
From-SVN: r269699
* hash-table.h (remove_elt_with_hash): Return if slot is NULL rather
than if is_empty (*slot).
* hash-set-tests.c (test_set_of_strings): Add tests for addition of
existing elt and for elt removal.
* hash-map-tests.c (test_map_of_strings_to_int): Add test for removal
of already removed elt.
* hashtab.c (htab_remove_elt_with_hash): Return if slot is NULL rather
than if *slot is HTAB_EMPTY_ENTRY.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r269695
2019-03-14 Thomas Koenig <tkoenig@gcc.gnu.org>
* gfortran.texi: Document Q edit descriptor under
" Extensions not implemented in GNU Fortran".
From-SVN: r269690
PR ipa/89684
* multiple_target.c (create_dispatcher_calls): Change
references_to_redirect from vector of ipa_ref * to vector of ipa_ref.
In the node->iterate_referring loop, push *ref rather than ref, call
ref->remove_reference () and always pass 0 to iterate_referring.
* gcc.target/i386/pr89684.c: New test.
From-SVN: r269681
PR rtl-optimization/89679
* expmed.c (expand_mult_const): Don't add a REG_EQUAL note if it
would contain a paradoxical SUBREG.
* gcc.dg/pr89679.c: New test.
From-SVN: r269680
2019-03-14 Richard Biener <rguenther@suse.de>
PR middle-end/89698
* fold-const.c (operand_equal_p): For INDIRECT_REF check
that the access types are similar.
* g++.dg/torture/pr89698.C: New testcase.
From-SVN: r269677
PR tree-optimization/89703
* tree-ssa-strlen.c (valid_builtin_call): Punt if stmt call types
aren't compatible also with builtin_decl_explicit. Check pure
or non-pure status of BUILT_IN_STR{{,N}CMP,N{LEN,{CAT,CPY}{,_CHK}}}
and BUILT_IN_STPNCPY{,_CHK}.
* gcc.c-torture/compile/pr89703-1.c: New test.
* gcc.c-torture/compile/pr89703-2.c: New test.
From-SVN: r269674
32-bit indices in VSIB address are sign-extended to 64 bits. In x32,
when 32-bit indices are used as addresses, like in
vgatherdps %ymm7, 0(,%ymm9,1), %ymm6
32-bit indices, 0xf7fa3010, is sign-extended to 0xfffffffff7fa3010 which
is invalid address. Add addr32 prefix to UNSPEC_VSIBADDR instructions
for x32 if there is no base register nor symbol.
This fixes 175.vpr and 254.gap in SPEC CPU 2000 on x32 with
-Ofast -funroll-loops -march=haswell
gcc/
PR target/89523
* config/i386/i386.c (ix86_print_operand): Handle 'M' to add
addr32 prefix to VSIB address for X32.
* config/i386/sse.md (*avx512pf_gatherpf<mode>sf_mask): Prepend
"%M2" to opcode.
(*avx512pf_gatherpf<mode>df_mask): Likewise.
(*avx512pf_scatterpf<mode>sf_mask): Likewise.
(*avx512pf_scatterpf<mode>df_mask): Likewise.
(*avx2_gathersi<mode>): Prepend "%M3" to opcode.
(*avx2_gathersi<mode>_2): Prepend "%M2" to opcode.
(*avx2_gatherdi<mode>): Prepend "%M3" to opcode.
(*avx2_gatherdi<mode>_2): Prepend "%M2" to opcode.
(*avx2_gatherdi<mode>_3): Prepend "%M3" to opcode.
(*avx2_gatherdi<mode>_4): Prepend "%M2" to opcode.`
(*avx512f_gathersi<mode>): Prepend "%M4" to opcode.
(*avx512f_gathersi<mode>_2): Prepend "%M3" to opcode.
(*avx512f_gatherdi<mode>): Prepend "%M4" to opcode.
(*avx512f_gatherdi<mode>_2): Prepend "%M3" to opcode.
(*avx512f_scattersi<mode>): Prepend "%M0" to opcode.
(*avx512f_scatterdi<mode>): Likewise.
gcc/testsuite/
PR target/89523
* gcc.target/i386/pr89523-1a.c: New test.
* gcc.target/i386/pr89523-1b.c: Likewise.
* gcc.target/i386/pr89523-2.c: Likewise.
* gcc.target/i386/pr89523-3.c: Likewise.
* gcc.target/i386/pr89523-4.c: Likewise.
* gcc.target/i386/pr89523-5.c: Likewise.
* gcc.target/i386/pr89523-6.c: Likewise.
* gcc.target/i386/pr89523-7.c: Likewise.
* gcc.target/i386/pr89523-8.c: Likewise.
* gcc.target/i386/pr89523-9.c: Likewise.
From-SVN: r269673
PR c++/89652
* constexpr.c (struct constexpr_ctx): Change save_exprs type from
hash_set<tree> to vec<tree>.
(cxx_eval_call_expression): Adjust for save_exprs being a vec instead
of hash_set.
(cxx_eval_loop_expr): Likewise. Truncate the vector after each
removal of SAVE_EXPRs from values.
(cxx_eval_constant_expression) <case SAVE_EXPR>: Call safe_push
method on save_exprs instead of add.
* g++.dg/cpp1y/constexpr-89652.C: New test.
From-SVN: r269671
This is an overlooked case in C++17 mandatory copy elision: We want overload
resolution to reflect that initializing an object from a prvalue does not
involve a copy or move constructor even when [over.match.ctor] says that
only constructors are candidates. Here I implement that by looking through
the copy/move constructor in joust.
* call.c (joust_maybe_elide_copy): New.
(joust): Call it.
From-SVN: r269667