summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * Darwin: Fix empty g++ command lines [PR105599].Iain Sandoe2022-05-291-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An empty g++ command line should produce a diagnostic that there are no inputs. The PR is that currently Darwin produces a dignostic about missing link items instead - this is because (errnoeously), for this driver, we are creating a link job for empty command lines. The problem occurs in four stages: The g++ driver appends -shared-libgcc to the command line. The Darwin driver_init code in the backend does not see this (it sees an empty command line). When the back end driver code driver sees an empty command line, it does not add any supplementary flags (e.g. asm-macosx-version-min) - precisely to avoid anything being claimed as an input_file and therefore triggering a link line. Since we do not have a value for asm-macosx-version-min when processing the driver specs, we unconditionally inject 'multiply_defined suppress' which is used with shared libgcc (but only intended on very old Darwin). This then causes the generation of a link job. The solution, for the present, is to move version-specific link params to the LINK_SPEC so that they are only processed when a link job has already been decided. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR target/105599 gcc/ChangeLog: * config/darwin.h: Move versions-specific handling of multiply_defined from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC.
| * sourcebuild.texi: Document toplevel directoriesEric Gallager2022-05-291-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | Fixes PR82383 gcc/ChangeLog: PR other/82383 * doc/sourcebuild.texi: Add entries for the c++tools, gotools, libbacktrace, libcc1, libcody, liboffloadmic, and libsanitizer directories. Remove entry for boehm-gc. Fix alphabetization for libquadmath.
| * Daily bump.GCC Administrator2022-05-2910-1/+99
| |
| * [PATCH 1/2] avr: Added AVR-DA and DB MCU seriesJoel Holdsworth2022-05-284-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | gcc/ * config/avr/avr-mcus.def: Add device definitions. * doc/avr-mmcu.texi: Corresponding changes. * config/avr/gen-avr-mmcu-texi.cc: Added support for avr device prefix. * config/avr/gen-avr-mmcu-specs.cc: Prevent -mmcu=avr* flags from leaking into cc1. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
| * OpenMP/Fortran: Add support for enter clause on declare targetTobias Burnus2022-05-288-32/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fortran version to C/C++ commit r13-797-g0ccba4ed8571c18c7015413441e971 gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_clauses): Handle OMP_LIST_ENTER. * gfortran.h: Add OMP_LIST_ENTER. * openmp.cc (enum omp_mask2, OMP_DECLARE_TARGET_CLAUSES): Add OMP_CLAUSE_ENTER. (gfc_match_omp_clauses, gfc_match_omp_declare_target, resolve_omp_clauses): Handle 'enter' clause. libgomp/ChangeLog: * libgomp.texi (OpenMP 5.2): Mark 'enter' clause as supported. * testsuite/libgomp.fortran/declare-target-1.f90: Extend to test explicit 'to' and 'enter' clause. * testsuite/libgomp.fortran/declare-target-2.f90: Update accordingly. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/declare-target-2.f90: Add 'enter' clause test. * gfortran.dg/gomp/declare-target-4.f90: Likewise.
| * Fix ICE on shVladimir Makarov2022-05-281-0/+6
| | | | | | | | | | | | | | gcc/ PR target/103722 * config/sh/sh.cc (sh_register_move_cost): Avoid cost "2" (which is special) for various scenarios.
| * Vim swap files not ignoredBruce Korb2022-05-281-0/+1
| | | | | | | | | | | | ChangeLog: * .gitignore: Ignore vim swap files
| * libbacktrace: update READMEIan Lance Taylor2022-05-281-12/+20
| | | | | | | | | | PR libbacktrace/105721 * README: Update.
| * Darwin: Amend REAL_LIBGCC_SPEC comment [NFC].Iain Sandoe2022-05-281-25/+13
| | | | | | | | | | | | | | | | | | | | | | | | This comment had got out of sync with reality, partly due to merging of patches. Updated to reflect the current implementation. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.h (REAL_LIBGCC_SPEC): Update the comment block describing this macro.
| * Rename OSCONS_CC to GCC_FOR_ADA_RTSAlexandre Oliva2022-05-281-20/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several gnatlib* targets perform, with a subshell and sed, the same GCC_FOR_TARGET pathname transformation that OSCONS_CC performs with make subst macros. Rename OSCONS_CC to a more general name, and use it for gnatlib as well. for gcc/ada/ChangeLog * gcc-interface/Makefile.in (OSCONS_CC): Rename to... (GCC_FOR_ADA_RTS): ... this. Adjust users. (gnatlib): Pass it down as CC. (gnatlib-shared-default): Likewise. (gnatlib-shared-win32, gnatlib-shared-darwin): Likewise.
| * libgomp: Don't define GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC for _aligned_malloc ↵Jakub Jelinek2022-05-282-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [PR105745] since apparently _aligned_malloc requires freeing with _aligned_free and: /* Defined if gomp_aligned_alloc doesn't use fallback version and free can be used instead of gomp_aligned_free. */ #define GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC 1 so the second condition isn't satisfied. For uses inside of the OpenMP allocators we can still use _aligned_malloc but we need to call _aligned_free in gomp_aligned_free. 2022-05-28 Jakub Jelinek <jakub@redhat.com> PR libgomp/105745 * libgomp.h (GOMP_HAVE_EFFICIENT_ALIGNED_ALLOC): Don't define for defined(HAVE__ALIGNED_MALLOC) case. * alloc.c (gomp_aligned_alloc): Move defined(HAVE__ALIGNED_MALLOC) handling as last option before fallback instead of first. (gomp_aligned_free): For defined(HAVE__ALIGNED_MALLOC) call _aligned_free.
| * openmp: Adjust diagnostics about same variable in link and to/enter clausesJakub Jelinek2022-05-283-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Fri, May 27, 2022 at 04:52:17PM +0200, Tobias Burnus wrote: > The 'TO'/'ENTER' usage is first stored in a linked list – and > then as attribute to the symbol. I am not sure how to handle it best. This reminds me I've left the C/C++ FE diagnostics about mixing link and to/enter on the same variable in separate directives as is, so it always talked about mixing link and to clauses. This patch adjusts it, so that if link is first, it talks about the clause actually used and if link is later, uses to or enter together in the wording. 2022-05-28 Jakub Jelinek <jakub@redhat.com> gcc/c/ * c-parser.cc (c_parser_omp_declare_target): If OMP_CLAUSE_LINK was seen first, use "%<to%>" or "%<enter%>" depending on OMP_CLAUSE_ENTER_TO of the current clause, otherwise use "%<to%> or %<enter%>" wording. gcc/cp/ * parser.cc (handle_omp_declare_target_clause): If OMP_CLAUSE_LINK was seen first, use "%<to%>" or "%<enter%>" depending on OMP_CLAUSE_ENTER_TO of the current clause, otherwise use "%<to%> or %<enter%>" wording. gcc/testsuite/ * c-c++-common/gomp/declare-target-2.c: Add further tests for mixing of link and to/enter clauses on separate directives.
| * c++: lambda in concept [PR105652]Jason Merrill2022-05-272-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently check satisfaction in the context of the constrained declaration (which may be wrong, see PR104111). When checking C<int> for S<int>, we currently substitute into the lambda in the context of S<T> (rather than S<int>, which seems wrong if the above isn't wrong), so the new closure type thinks its context is S<T>, which confuses debug output. For the moment, let's work around all of this by overriding the context of the closure. PR c++/105652 gcc/cp/ChangeLog: * pt.cc (tsubst_lambda_expr): Don't let a namespace-scope lambda instantiate into a class-scope lambda. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-lambda20.C: New test.
| * Daily bump.GCC Administrator2022-05-2812-1/+214
| |
| * d: Merge upstream dmd 4d07f22f2, druntime f89da313, phobos d46814c86.Iain Buclaw2022-05-2782-1854/+2497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | D front-end changes: - `scope' semantics are now enforced in `@safe' code on pointers to stack memory, but only as deprecation warnings. - Overriding virtual functions are now marked with the `override' and `final' in the generated headers of `-fdump-c++-spec='. - `-fpreview=fiximmmutableconv` has been added that disallows implicitly converting a return value with indirections to immutable if it determines the result must be unique. D runtime changes: - Posix (excluding Darwin): Switch default GC signals from SIGUSR1/2 to SIGRTMIN/SIGRTMIN+1 Phobos changes: - Import latest bug fixes to mainline. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 4d07f22f2 * d-lang.cc (d_handle_option): Handle OPT_fpreview_fiximmutableconv. * lang.opt (fpreview=fiximmutableconv): New option. * runtime.def (ARRAYAPPENDT): Remove. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime f89da313. * src/MERGE: Merge upstream phobos d46814c86. Signed-off-by: Iain Buclaw <ibuclaw@gdcproject.org>
| * c++: Fix ICE with -Wmismatched-tags [PR105725]Marek Polacek2022-05-272-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we ICE with -Wmismatched-tags on something like template <class T> bool B<T, enable_if_t<is_class_v<class T::foo>>>; Specifically, the "class T::foo" bit. There, class_decl_loc_t::add gets a TYPENAME_TYPE as TYPE, rather than a class/union type, so checking TYPE_BEING_DEFINED will crash. I think it's OK to allow a TYPENAME_TYPE to slip into that function; we just shouldn't consider the 'class' tag redundant (which works as a 'typename'). In fact, every other compiler *requires* it. PR c++/105725 gcc/cp/ChangeLog: * parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P. gcc/testsuite/ChangeLog: * g++.dg/warn/Wmismatched-tags-10.C: New test.
| * c-family: fix attribute constructor ICE [PR90658]Marek Polacek2022-05-272-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here the C compiler crashes because a FUNCTION_DECL got into get_priority -> default_conversion, and the C FE's version of d_c specifically asserts that it doesn't get a FUNCTION_DECL. All uses of default_conversion in c-attribs.cc are guarded by != IDENTIFIER_NODE && != FUNCTION_DECL, but get_priority was only checking IDENTIFIER_NODE. PR c/90658 gcc/c-family/ChangeLog: * c-attribs.cc (get_priority): Check FUNCTION_DECL. gcc/testsuite/ChangeLog: * c-c++-common/attr-cdtor-1.c: New test.
| * libstdc++: Mark non-exported function always_inline [PR105671]Jonathan Wakely2022-05-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new function was added for gcc 11.1 but is not exported from the shared library. Depending on inlining decisions, its callers might get inlined but an external definition be needed for this function. That then fails to link. Since we can't add the export to the gcc-11 release branch now, mark it always_inline. We can consider exporting it for gcc-13 if/when we bump the shared library version (and maybe also for gcc-12 which is currently at the same version as trunk). For now, the attribute will solve the problem on all affected branches. The function is small enough that force-inlining it shouldn't cause problems. libstdc++-v3/ChangeLog: PR libstdc++/105671 * include/std/sstream (basic_stringbuf::_M_high_mark): Add always_inline attribute.
| * Fortran: Fix OpenMP clause name in error messageTobias Burnus2022-05-273-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | gcc/fortran/ChangeLog: * openmp.cc (gfc_check_omp_requires): Fix clause name in error. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/requires-4.f90: Update dg-error. * gfortran.dg/gomp/requires-8.f90: Update dg-error. Co-authored-by: Chung-Lin Tang <cltang@codesourcery.com>
| * Avoid shift in get_ref_base_and_extentRichard Biener2022-05-271-3/+2
| | | | | | | | | | | | | | This avoids one instance of a shift from bytes to bits in get_ref_base_and_extent by using TYPE_SIZE instead of TYPE_SIZE_UNIT. * tree-dfa.cc (get_ref_base_and_extent): Avoid shift.
| * ipa: Check cst type when propagating controled uses infoMartin Jambor2022-05-272-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 105639 shows that code with type-mismatches can trigger an assert after runnning into a branch that was inteded only for references to variables - as opposed to references to functions. Fixed by moving the condition from the assert to the guarding if statement. gcc/ChangeLog: 2022-05-25 Martin Jambor <mjambor@suse.cz> PR ipa/105639 * ipa-prop.cc (propagate_controlled_uses): Check type of the constant before adding a LOAD reference. gcc/testsuite/ChangeLog: 2022-05-25 Martin Jambor <mjambor@suse.cz> PR ipa/105639 * gcc.dg/ipa/pr105639.c: New test.
| * openmp: Add support for enter clause on declare targetJakub Jelinek2022-05-2718-44/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenMP 5.1 and earlier had 2 different uses of to clause, one for target update construct with one semantics, and one for declare target directive with a different semantics. Under the hood we were using OMP_CLAUSE_TO_DECLARE to represent the latter. OpenMP 5.2 renamed the declare target clause to to enter, the old one is kept as a deprecated alias. As we are far from having full OpenMP 5.2 support, this patch adds support for the enter clause (and renames OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER with a flag to tell the spelling of the clause for better diagnostics), but doesn't deprecate the to clause on declare target just yet (that should be done as one of the last steps in 5.2 support). 2022-05-27 Jakub Jelinek <jakub@redhat.com> gcc/ * tree-core.h (enum omp_clause_code): Rename OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER. * tree.h (OMP_CLAUSE_ENTER_TO): Define. * tree.cc (omp_clause_num_ops, omp_clause_code_name): Rename OMP_CLAUSE_TO_DECLARE to OMP_CLAUSE_ENTER. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE, if OMP_CLAUSE_ENTER_TO, print "to" instead of "enter". * tree-nested.cc (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE. gcc/c-family/ * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ENTER. gcc/c/ * c-parser.cc (c_parser_omp_clause_name): Parse enter clause. (c_parser_omp_all_clauses): For to clause on declare target, use OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER. (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause. (c_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE. * c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause name in diagnostics instead of omp_clause_code_name[OMP_CLAUSE_CODE (c)]. gcc/cp/ * parser.cc (cp_parser_omp_clause_name): Parse enter clause. (cp_parser_omp_all_clauses): For to clause on declare target, use OMP_CLAUSE_ENTER clause with OMP_CLAUSE_ENTER_TO instead of OMP_CLAUSE_TO_DECLARE clause. Handle PRAGMA_OMP_CLAUSE_ENTER. (OMP_DECLARE_TARGET_CLAUSE_MASK): Add enter clause. (cp_parser_omp_declare_target): Use OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE. * semantics.cc (finish_omp_clauses): Handle OMP_CLAUSE_ENTER instead of OMP_CLAUSE_TO_DECLARE, to OMP_CLAUSE_ENTER_TO use "to" as clause name in diagnostics instead of omp_clause_code_name[OMP_CLAUSE_CODE (c)]. gcc/testsuite/ * c-c++-common/gomp/clauses-3.c: Add tests with enter clause instead of to or modify some existing to clauses to enter. * c-c++-common/gomp/declare-target-1.c: Likewise. * c-c++-common/gomp/declare-target-2.c: Likewise. * c-c++-common/gomp/declare-target-3.c: Likewise. * g++.dg/gomp/attrs-9.C: Likewise. * g++.dg/gomp/declare-target-1.C: Likewise. libgomp/ * testsuite/libgomp.c-c++-common/target-40.c: Modify some existing to clauses to enter. * testsuite/libgomp.c/target-41.c: Likewise.
| * tree-optimization/105726 - adjust array bound heuristicRichard Biener2022-05-272-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's heuristic to detect ptr[1].a[...] out of bound accesses reasoning that if ptr points to an array of aggregates a trailing incomplete array has to have size zero. The following more thoroughly constrains the cases this applies to avoid false positive diagnostics. 2022-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/105726 * gimple-ssa-warn-restrict.cc (builtin_memref::set_base_and_offset): Constrain array-of-flexarray case more. * g++.dg/warn/Warray-bounds-27.C: New testcase.
| * fold-const: Fix up -fsanitize=null in C++ [PR105729]Jakub Jelinek2022-05-272-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following testcase triggers a false positive UBSan binding a reference to null diagnostics. In the FE we instrument conversions from pointer to reference type to diagnose at runtime if the operand of such a conversion is 0. The problem is that a GENERIC folding folds ((const struct Bar *) ((const struct Foo *) this)->data) + (sizetype) range_check (x) conversion to const struct Bar & by converting to that the first operand of the POINTER_PLUS_EXPR. But that changes when the -fsanitize=null binding to reference runtime check occurs. Without the optimization, it is invoked on the result of the POINTER_PLUS_EXPR, and as range_check call throws, that means it never triggers in the testcase. With the optimization, it checks whether this->data is NULL and it is. The following patch avoids that optimization during GENERIC folding when -fsanitize=null is enabled and it is a cast from non-REFERENCE_TYPE to REFERENCE_TYPE. 2022-05-27 Jakub Jelinek <jakub@redhat.com> PR sanitizer/105729 * fold-const.cc (fold_unary_loc): Don't optimize (X &) ((Y *) z + w) to (X &) z + w if -fsanitize=null during GENERIC folding. * g++.dg/ubsan/pr105729.C: New test.
| * libgomp.texi: Add more to-be-implemented OpenMP 5.2 featuresTobias Burnus2022-05-271-1/+16
| | | | | | | | | | | | | | libgomp/ * libgomp.texi (Other new OpenMP 5.1 features): Add 'begin declare target'. (Other new OpenMP 5.2 features): New.
| * Canonicalize X&-Y as X*Y in match.pd when Y is [0,1].Roger Sayle2022-05-272-45/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "For every pessimization, there's an equal and opposite optimization". In the review of my original patch for PR middle-end/98865, Richard Biener pointed out that match.pd shouldn't be transforming X*Y into X&-Y as the former is considered cheaper by tree-ssa's cost model (operator count). A corollary of this is that we should instead be transforming X&-Y into the cheaper X*Y as a preferred canonical form (especially as RTL expansion now intelligently selects the appropriate implementation based on the target's costs). With this patch we now generate identical code for: int foo(int x, int y) { return -(x&1) & y; } int bar(int x, int y) { return (x&1) * y; } specifically on x86_64-pc-linux-gnu both use and/neg/and with -O2, but both use and/mul with -Os. One minor wrinkle/improvement is that this patch includes three additional optimizations (that account for the change in canonical form) to continue to optimize PR92834 and PR94786. 2022-05-27 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * match.pd (match_zero_one_valued_p): New predicate. (mult @0 @1): Use zero_one_valued_p for optimization to the expression "bit_and @0 @1". (bit_and (negate zero_one_valued_p@0) @1): Optimize to MULT_EXPR. (plus @0 (mult (minus @1 @0) zero_one_valued_p@2)): New transform. (minus @0 (mult (minus @0 @1) zero_one_valued_p@2)): Likewise. (bit_xor @0 (mult (bit_xor @0 @1) zero_one_valued_p@2)): Likewise. Remove three redundant transforms obsoleted by the three above. gcc/testsuite/ChangeLog * gcc.dg/pr98865.c: New test case.
| * Pre-reload splitter to transform and;cmp into not;test on x86.Roger Sayle2022-05-275-4/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common idiom for testing if a specific set of bits is set in a value is to use "(X & Y) == Y", which on x86 results in an AND followed by a CMP. A slightly improved implementation is to instead use (~X & Y)==0, that uses a NOT and a TEST (or ANDN where available); still two "fast" instructions, but typically shorter especially if Y is an immediate constant. Because the above transformation would require more gimple statements in SSA, and may only be a win on targets with flags registers, it isn't performed by the middle-end, instead leaving this choice to the backend. As an example, here's the change in code generation for pr91400-1.c [which now requires a tweak to its dg-final clauses]. Before: movl __cpu_model+12(%rip), %eax andl $68, %eax // 3 bytes cmpl $68, %eax // 3 bytes sete %al ret After: movl __cpu_model+12(%rip), %eax notl %eax // 2 bytes testb $68, %al // 2 bytes sete %al ret 2022-05-27 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog * config/i386/i386.md (*test<mode>_not): New define_insn_and_split to split a combined "and;cmp" sequence into "not;test". gcc/testsuite/ChangeLog * gcc.target/i386/pr91400-1.c: Update for improved code generation. * gcc.target/i386/pr91400-2.c: Likewise. * gcc.target/i386/testnot-1.c: New test case. * gcc.target/i386/testnot-2.c: Likewise.
| * Close gcc-9 branchRichard Biener2022-05-271-1/+1
| | | | | | | | | | | | | | | | This removes gcc-9 from getting DATESTAMP updates. gcc/contrib/ * gcc-changelog/git_update_version.py (active_refs): Remove releases/gcc-9.
| * xtensa: Improve bswap[sd]i2 insn patternsTakayuki 'January June' Suwa2022-05-265-30/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes bswap[sd]i2 better register allocation, and reconstructs bswapsi2 in order to take advantage of GIMPLE manual byte-swapping recognition. gcc/ChangeLog: * config/xtensa/xtensa.md (bswapsi2): New expansion pattern. (bswapsi2_internal): Revise the template and condition, and add detection code for preceding the same insn in order to omit a "SSAI 8" instruction of the latter. (bswapdi2): Suppress built-in insn expansion with the corresponding library call when optimizing for size. gcc/testsuite/ChangeLog: * gcc.target/xtensa/bswap.c: Remove test. * gcc.target/xtensa/bswap-O1.c: New. * gcc.target/xtensa/bswap-O2.c: Ditto. * gcc.target/xtensa/bswap-Os.c: Ditto.
| * xtensa: Add setmemsi insn patternTakayuki 'January June' Suwa2022-05-264-1/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces setmemsi insn pattern of two kinds, unrolled loop and small loop, for fixed small length and constant initialization value. gcc/ChangeLog: * config/xtensa/xtensa-protos.h (xtensa_expand_block_set_unrolled_loop, xtensa_expand_block_set_small_loop): New prototypes. * config/xtensa/xtensa.cc (xtensa_sizeof_MOVI, xtensa_expand_block_set_unrolled_loop, xtensa_expand_block_set_small_loop): New functions. * config/xtensa/xtensa.md (setmemsi): New expansion pattern. * config/xtensa/xtensa.opt (mlongcalls): Add target mask.
| * Daily bump.GCC Administrator2022-05-275-1/+346
| |
| * libstdc++: Fix narrowing conversions for 16-bit size_t [PR105681]Jonathan Wakely2022-05-262-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On a 16-bit target such as msp430 we get errors about narrowing long values to size_t, which is only 16-bit. When --enable-libstdcxx-pch is used the <bits/extc++.h> header breaks the build because of these narrowing errors. libstdc++-v3/ChangeLog: PR libstdc++/105681 * include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp: Limit ga_sizes array to values that fit in size_t. * include/ext/random [__SIZE_WIDTH < 32] (sfmt86243) (sfmt86243_64, sfmt132049, sfmt132049_64, sfmt216091) (sfmt216091_64): Do not declare.
| * libstdc++: Fix atomic and error_code printers for versioned namespaceJonathan Wakely2022-05-261-3/+12
| | | | | | | | | | | | | | | | | | | | | | This fixes the printers to work with std::__8::atomic and std::__v8::ios_errc and std::__v8::future_errc. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Make lookup for ios_errc and future_errc check versioned namespace. (StdAtomicPrinter): Strip versioned namespace from typename.
| * libstdc++: Move std::iostream_category() definition to new fileJonathan Wakely2022-05-265-50/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a missing symbol when the dual ABI is disabled, e.g. for the versioned namespace build. libstdc++-v3/ChangeLog: * src/c++11/Makefile.am: Add new source file. * src/c++11/Makefile.in: Regenerate. * src/c++11/cxx11-ios_failure.cc (iostream_category): Move to ... * src/c++11/ios_errcat.cc: New file. * testsuite/27_io/ios_base/failure/error_code.cc: Check that std::iostream_category() is defined and used for std::io_errc.
| * c++: improve -Waddress warnings with *_cast [PR105569]Marek Polacek2022-05-262-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves the diagnostic for -Waddress when it warns for if (dynamic_cast<A*>(&ref)) // ... where 'ref' is a reference, which cannot be null. In particular, it changes warning: comparing the result of pointer addition '(((A*)ref) + ((sizetype)(*(long int*)((& ref)->B::_vptr.B + -24))))' and NULL to warning: the compiler can assume that the address of 'ref' will never be NULL PR c++/105569 gcc/cp/ChangeLog: * typeck.cc (warn_for_null_address): Improve the warning when the POINTER_PLUS_EXPR's base is of reference type. gcc/testsuite/ChangeLog: * g++.dg/warn/Waddress-9.C: New test.
| * xtensa: Fix instruction counting regarding block move expansionTakayuki 'January June' Suwa2022-05-261-4/+4
| | | | | | | | | | | | | | | | | | | | This patch makes counting the number of instructions of the remainder (modulo 4) part more accurate. gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_expand_block_move): Make instruction counting more accurate, and simplify emitting insns.
| * xtensa: Make use of IN_RANGE macro where appropriateTakayuki 'January June' Suwa2022-05-264-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional changes. gcc/ChangeLog: * config/xtensa/constraints.md (M, O): Use the macro. * config/xtensa/predicates.md (addsubx_operand, extui_fldsz_operand, sext_fldsz_operand): Ditto. * config/xtensa/xtensa.cc (xtensa_simm8, xtensa_simm8x256, xtensa_simm12b, xtensa_uimm8, xtensa_uimm8x2, xtensa_uimm8x4, xtensa_mask_immediate, smalloffset_mem_p, printx, xtensa_call_save_reg, xtensa_expand_prologue): Ditto. * config/xtensa/xtensa.h (FUNCTION_ARG_REGNO_P): Ditto.
| * xtensa: Simplify EXTUI instruction maskimm validationsTakayuki 'January June' Suwa2022-05-262-22/+4
| | | | | | | | | | | | | | | | | | | | No functional changes. gcc/ChangeLog: * config/xtensa/predicates.md (extui_fldsz_operand): Simplify. * config/xtensa/xtensa.cc (xtensa_mask_immediate, print_operand): Ditto.
| * libstdc++: Add constexpr to std::counted_iterator post-increment (LWG 3643)Jonathan Wakely2022-05-262-2/+28
| | | | | | | | | | | | | | | | libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (counted_iterator::operator++(int)): Add 'constexpr' as per LWG 3643. * testsuite/24_iterators/counted_iterator/lwg3643.cc: New test.
| * c++: constrained partial spec forward decl [PR96363]Patrick Palka2022-05-266-24/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here during cp_parser_single_declaration for #2, we were calling associate_classtype_constraints for TPL<T> (the primary template type) before maybe_process_partial_specialization could get a chance to notice that we're in fact declaring a distinct constrained partial spec and not redeclaring the primary template. This caused us to emit a bogus error about differing constraints b/t the primary template and #2's constraints. This patch fixes this by moving the call to associate_classtype_constraints after the call to shadow_tag (which calls maybe_process_partial_specialization) and adjusting shadow_tag to use the return value of m_p_p_s. Moreover, if we later try to define a constrained partial specialization that's been declared earlier (as in the third testcase), then maybe_new_partial_specialization correctly notices it's a redeclaration and returns NULL_TREE. But in this case we also need to update TYPE to point to the redeclared partial spec (it'll otherwise continue pointing to the primary template type, eventually leading to a bogus error). PR c++/96363 gcc/cp/ChangeLog: * decl.cc (shadow_tag): Use the return value of maybe_process_partial_specialization. * parser.cc (cp_parser_single_declaration): Call shadow_tag before associate_classtype_constraints. * pt.cc (maybe_new_partial_specialization): Change return type to bool. Take 'type' argument by mutable reference. Set 'type' to point to the correct constrained specialization when appropriate. (maybe_process_partial_specialization): Adjust accordingly. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-partial-spec12.C: New test. * g++.dg/cpp2a/concepts-partial-spec12a.C: New test. * g++.dg/cpp2a/concepts-partial-spec13.C: New test.
| * libstdc++: Refactor includes for unordered containersJonathan Wakely2022-05-267-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves some #include directives to the relevant place. For example, <bits/hashtable_policy.h> needs <bits/stl_pair.h> so should include it directly instead of relying on <unordered_map> and <unordered_set> to do so first. libstdc++-v3/ChangeLog: * include/bits/functional_hash.h (__is_fast_hash): Add doxygen comment. * include/bits/hashtable.h: Do not include <bits/stl_function.h> here. * include/bits/hashtable_policy.h: Include <bits/stl_pair.h> and <bits/functional_hash.h>. * include/bits/unordered_map.h: Include required headers. * include/bits/unordered_set.h: Likewise. * include/std/unordered_map: Do not include headers for indirect dependencies. * include/std/unordered_set: Likewise.
| * libstdc++: Remove some unnecessary includesJonathan Wakely2022-05-263-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | These headers do not use anything in <bits/stl_iterator_base_types.h> directly, and it's included by <bits/stl_iterator_base_funcs.h> and <bits/stl_iterator.h> anyway, because they do need it. libstdc++-v3/ChangeLog: * include/bits/ranges_algobase.h: Do not include <bits/stl_iterator_base_types.h>. * include/std/string: Likewise. * include/std/variant: Likewise.
| * libstdc++: Make headers include their prerequisitesNathan Sidwell2022-05-264-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These headers were relying on their includers having already included some prerequisites. That makes them unsuitable to be header-units. So directly include the needed headers. Reviewed-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * include/bits/hashtable.h: Include required headers. * include/bits/hashtable_policy.h: Likewise. * include/bits/stl_heap.h: Likewise. * include/bits/stl_iterator_base_funcs.h: Likewise.
| * libstdc++: Fix printing of std::span for versioned namespaceFrançois Dumont2022-05-261-2/+2
| | | | | | | | | | | | | | libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdSpanPrinter.__init__): Strip typename from version namespace.
| * libstdc++: Fix printing of std::atomic<shared_ptr<T>> for versioned namespaceJonathan Wakely2022-05-261-1/+2
| | | | | | | | | | | | | | libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (SharedPointerPrinter): Strip versioned namespace from the template argument too.
| * libstdc++: Rename tests like .../wchar_t/1.cc to .../wchar_t.ccJonathan Wakely2022-05-2652-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to have directories containing a single test file, we can rename the files to the directory names and remove the directories. The dejagnu proc that filters out wchar_t tests just checks for "wchar_t" anywhere in the path, so will work just as well on wchar_t.cc or constexpr-wchar_t.cc paths. libstdc++-v3/ChangeLog: * testsuite/21_strings/basic_string/modifiers/pop_back/char/1.cc: Moved to... * testsuite/21_strings/basic_string/modifiers/pop_back/char.cc: ...here. * testsuite/21_strings/basic_string/modifiers/pop_back/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/modifiers/pop_back/wchar_t.cc: ...here. * testsuite/21_strings/basic_string/modifiers/swap/wchar_t/constexpr.cc: Moved to... * testsuite/21_strings/basic_string/modifiers/swap/constexpr-wchar_t.cc: ...here. * testsuite/21_strings/basic_string/modifiers/swap/char/constexpr.cc: Moved to... * testsuite/21_strings/basic_string/modifiers/swap/constexpr.cc: ...here. * testsuite/21_strings/basic_string/operations/contains/char/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/contains/char.cc: ...here. * testsuite/21_strings/basic_string/operations/contains/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/contains/wchar_t.cc: ...here. * testsuite/21_strings/basic_string/operations/data/char/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/data/char.cc: ...here. * testsuite/21_strings/basic_string/operations/data/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/data/wchar_t.cc: ...here. * testsuite/21_strings/basic_string/operations/ends_with/char/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/ends_with/char.cc: ...here. * testsuite/21_strings/basic_string/operations/ends_with/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/ends_with/wchar_t.cc: ...here. * testsuite/21_strings/basic_string/operations/starts_with/char/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/starts_with/char.cc: ...here. * testsuite/21_strings/basic_string/operations/starts_with/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/starts_with/wchar_t.cc: ...here. * testsuite/21_strings/basic_string/operations/substr/char/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/substr/char.cc: ...here. * testsuite/21_strings/basic_string/operations/substr/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/operations/substr/wchar_t.cc: ...here. * testsuite/21_strings/basic_string/range_access/char/1.cc: Moved to... * testsuite/21_strings/basic_string/range_access/char.cc: ...here. * testsuite/21_strings/basic_string/range_access/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/range_access/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char.cc: ...here. * testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char.cc: ...here. * testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/modifiers/swap/char.cc: ...here. * testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/operations/contains/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/contains/char.cc: ...here. * testsuite/21_strings/basic_string_view/operations/contains/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/contains/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/operations/data/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/data/char.cc: ...here. * testsuite/21_strings/basic_string_view/operations/data/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/data/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/operations/ends_with/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/ends_with/char.cc: ...here. * testsuite/21_strings/basic_string_view/operations/ends_with/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/ends_with/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/operations/starts_with/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/starts_with/char.cc: ...here. * testsuite/21_strings/basic_string_view/operations/starts_with/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/starts_with/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/operations/substr/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/substr/char.cc: ...here. * testsuite/21_strings/basic_string_view/operations/substr/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/operations/substr/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/range_access/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/range_access/char.cc: ...here. * testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/range_access/wchar_t.cc: ...here. * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char/1.cc: Moved to... * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char.cc: ...here. * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t/1.cc: Moved to... * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char16_t.cc: ...here. * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t/1.cc: Moved to... * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char32_t.cc: ...here. * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char8_t/1.cc: Moved to... * testsuite/21_strings/basic_string/requirements/explicit_instantiation/char8_t.cc: ...here. * testsuite/21_strings/basic_string/requirements/explicit_instantiation/1.cc: Moved to... * testsuite/21_strings/basic_string/requirements/explicit_instantiation/int.cc: ...here. * testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string/requirements/explicit_instantiation/wchar_t.cc: ...here. * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char/1.cc: Moved to... * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char.cc: ...here. * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char16_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char16_t.cc: ...here. * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char32_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char32_t.cc: ...here. * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char8_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/char8_t.cc: ...here. * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/1.cc: Moved to... * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/int.cc: ...here. * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/wchar_t/1.cc: Moved to... * testsuite/21_strings/basic_string_view/requirements/explicit_instantiation/wchar_t.cc: ...here. * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char/1.cc: Moved to... * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char.cc: ...here. * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char16_t/1.cc: Moved to... * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char16_t.cc: ...here. * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char32_t/1.cc: Moved to... * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char32_t.cc: ...here. * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char8_t/1.cc: Moved to... * testsuite/21_strings/char_traits/requirements/explicit_instantiation/char8_t.cc: ...here. * testsuite/21_strings/char_traits/requirements/explicit_instantiation/short/1.cc: Moved to... * testsuite/21_strings/char_traits/requirements/explicit_instantiation/short.cc: ...here. * testsuite/21_strings/char_traits/requirements/explicit_instantiation/wchar_t/1.cc: Moved to... * testsuite/21_strings/char_traits/requirements/explicit_instantiation/wchar_t.cc: ...here.
| * libstdc++: Remove redundancy in test pathnamesJonathan Wakely2022-05-263-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repeating "explicit_instantiation" in these long pathnames is not necessary. libstdc++-v3/ChangeLog: * testsuite/20_util/duration/requirements/explicit_instantiation/explicit_instantiation.cc: Moved to... * testsuite/20_util/duration/requirements/explicit_instantiation.cc: ...here. * testsuite/20_util/time_point/requirements/explicit_instantiation/explicit_instantiation.cc: Moved to... * testsuite/20_util/time_point/requirements/explicit_instantiation.cc: ...here. * testsuite/20_util/unique_ptr/requirements/explicit_instantiation/explicit_instantiation.cc: Moved to... * testsuite/20_util/unique_ptr/requirements/explicit_instantiation.cc: ...here.
| * Daily bump.GCC Administrator2022-05-2610-1/+239
| |
| * c++: fix ICE on invalid attributes [PR96637]Marek Polacek2022-05-254-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When chaining attributes, attr_chainon should be used rather than plain chainon, so that we don't end up with a TREE_LIST where one of the elements is error_mark_node, which causes problems. parser.cc has already been fixed to use attr_chainon, but decl.cc has not. Until now. PR c++/96637 gcc/cp/ChangeLog: * cp-tree.h (attr_chainon): Declare. * decl.cc (start_decl): Use attr_chainon. (grokdeclarator): Likewise. * parser.cc (cp_parser_statement): No longer static. gcc/testsuite/ChangeLog: * g++.dg/parse/error64.C: New test.
| * c++: CTAD with alias and nested template [PR105655]Jason Merrill2022-05-252-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here, alias_ctad_tweaks expect tsubst_decl of a FUNCTION_DECL to return a FUNCTION_DECL. A reasonable expectation, but in this case we were replacing the template args of the class-scope deduction guide with equivalent args, so looking in the hash table we found the partial instantiation stored when instantiating A<int>, which is a TEMPLATE_DECL. It's fine for that to be what is stored, but tsubst_function_decl should never return it. PR c++/105655 gcc/cp/ChangeLog: * pt.cc (build_template_decl): Add assert. (tsubst_function_decl): Don't return a template. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-alias13.C: New test.