The canonicalization of args code was originally thinking edges e1/e2
were edges out going from the cond block but they were the edges
coming into the join block. This rewrites the canonicalization of arg0/1
args to correct that mistake. And it fixes the wrong code that would
happen in this case.
PR tree-optimization/123645
gcc/ChangeLog:
* tree-ssa-phiopt.cc (cond_removal_in_builtin_zero_pattern): Rewrite
the canonicalization of the args code based on e1/e2 being edges into
the join block.
gcc/testsuite/ChangeLog:
* gcc.dg/torture/pr123645-1.c: New test.
* gcc.dg/torture/pr123645-2.c: New test.
Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
Jose E. Marchesi [Sat, 17 Jan 2026 22:50:31 +0000 (23:50 +0100)]
a68: do not use `^' for the pow operator
The RR mentions all of "**", "^" and "UP" as the representation of the
several pow operators for integral, real and complex operations. This
patch removes "^" from the list (and a remnant of "UP") and thus frees
that worthy character to be used for some other purpose in the future.
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog
* a68-parser-prelude.cc (stand_prelude): Remove definitions for ^
operator.
* ga68.texi (Real operators): Remove entries for ^.
(Integral operators): Likewise.
gcc/testsuite/ChangeLog
* algol68/execute/pow-real-1.a68: Adapt test to use ** rather than
^ for pow operator.
Jose E. Marchesi [Sat, 17 Jan 2026 22:03:34 +0000 (23:03 +0100)]
a68: new Coding Guidelines manual for Algol 68
This commit adds a new manual containing a few coding guidelines and
recommendations for writing Algol 68 code. The primary goal of the
document is to be used in the context of GCC development to achieve a
coherent style among the code base. However, other people may want to
adopt these coding conventions as well, so we are distributing them in
their own manual rather than as part of the ga68 internals manual.
Thanks to Chris Hermansen, Mohammad-Reza Nabipoor, Pietro Monteiro and
'jpl' James for their help and nice discussions in the algol68@
mailing list.
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog
Eric Botcazou [Sat, 17 Jan 2026 21:27:53 +0000 (22:27 +0100)]
Ada: Fix packed boolean array with Default_Component_Value aspect
Putting the Default_Component_Value aspect on a bit-packed array type has
never worked, so this plugs the loophole. For the sake of consistency,
the recent fix for PR ada/68179 is adjusted to use Has_Default_Aspect too.
gcc/ada/
PR ada/68179
PR ada/123589
* exp_ch3.adb (Expand_Freeze_Array_Type): Build an initialization
procedure for a bit-packed array type if Has_Default_Aspect is set
on the base type, but make sure not to build it twice. Also test
Has_Default_Aspect for a type derived from String.
gcc/testsuite/
* gnat.dg/component_value2.adb: New test.
Co-authored-by: Lisa Felidae <lisa@felidae.bam.moe>
Sandra Loosemore [Sat, 10 Jan 2026 20:27:36 +0000 (20:27 +0000)]
doc, nds32: Add missing documentation for nds32 options [PR122243]
This back end had numerous options defined that were not documented in
the manual. Descriptions were taken from the .opt file. I also did some
editorial cleanups in the .opt file text where appropriate.
doc, x86: Clean up x86 options documentation [PR122243]
Besides the usual fixes in this series to make the options summary
agree with the options listed in the detailed documentation and add
missing @opindex entries, I decided it was not very helpful to users
to have dozens of ISA extension options documented as a group spanning
multiple pages in the manual. I broke that up so each of those
options is described separately, using the documentation string from
the .opt file.
gcc/ChangeLog
PR other/122243
* config/i386/i386.opt (malign-functions): Mark undocumented/unused
option as Undocumented.
(malign-jumps): Likewise.
(malign-loops): Likewise.
(mbranch-cost, mforce-drap): Mark undocumented options likely
intended for developer use only as Undocumented.
(mstv): Correct sense of option in doc string.
(mavx512cd): Remove extra "and" from doc string.
(mavx512dq): Likewise.
(mavx512bw): Likewise.
(mavx512vl): Likewise.
(mavx512ifma): Likewise.
(mavx512bvmi): Likewise.
* doc/invoke.texi (Options Summary) <x86 Options>: Add
missing options. Correct whitespace and re-wrap long lines.
Remove -mthreads which is now classed as a MinGW option.
(Cygwin and MinGW Options): Replace existing documentation of
-mthreads with the more detailed text moved from x86 Options.
(x86 Options): Move introductory text about ISA extensions before
the individual options instead of after. Document them all
individually instead of as a group, and move immediately after
-march/-mtune documentation. Rewrap long lines. Document
interaction between SSE and AVX with -mfpmath=sse. Move -masm
documentation farther down instead of grouped with options
affecting floating-point behavior. Add missing @opindex
entries. Rewrite the -mdaz-ftz documentation. Document
-mstack-arg-probe. Copy-editing. Document -mstv. Remove
obsolete warning about -mskip-rax-setup in very old GCC versions.
Rewrite the -mapx-inline-asm-use-gpr32 documentation.
Document -mgather and -mscatter. Split -miamcu documentation
from -m32/-m64/etc. Rewrite -munroll-only-small-loops documentation.
Document -mdispatch-scheduler.
doc, visium: Clean up Visium options documentation [PR122243]
gcc/ChangeLog
PR other/122243
* config/visium/visium.opt (menable-trampolines): Mark Undocumented.
* doc/invoke.texi (Options Summary) <Visium Options>: Remove
redundant -mno- option.
(Visium Options): Copy-editing to put in active voice and add markup.
doc, Solaris: Clean up documentation of Solaris 2 options [PR122243]
gcc/ChangeLog
PR other/122243
* doc/invoke.texi (Option Summary) <Solaris 2 Options>:
Remove redundant negative option forms from list. List both
-pthread and -pthreads.
(Solaris 2 Options): Index and list the negative forms here.
Combine the two @table environments. Document both -pthread
and -pthreads.
doc, sh: Clean up SH options documentation [PR122243]
gcc/ChangeLog
PR other/122243
* config/sh/sh.opt (mhitachi, mpadstruct): Mark obsolete options
as Undocumented.
* doc/invoke.texi (Option Summary) <SH Options>: Add missing
entries for -m4-* and other options. Remove redundant -mno- entries
and obsolete options. Add missing options -mfdpic, -mlra.
(SH Options): Combine entries for -mrenesas and -mno-renesas.
Index and list -mno- forms for other options that have them.
Remove documentation for obsolete options -mpadstruct and
-mfused-madd. Add documentation for -mlra. Copy-edit and wrap long
lines throughout the section.
doc, s390: Clean up S/390 and z series options [PR122243]
There were numerous S/390 options missing entries in the manual.
Fortunately the documentation strings in the .opt file and previous
commit messages and patch mails explained these well enough that I
was able to fill in the missing material without too much trouble.
I marked a few that seemed to be for internal use or intentially not
exposed to the user as "Undocumented".
gcc/ChangeLog
PR other/122243
* config/s390/s390.opt (mbranch-cost): Mark as Undocumented.
* config/s390/tpf.opt (mtpf-trace-hook-prologue-check=): Likewise.
(mtpf-trace-hook-prologue-target=): Likewise.
(mtpf-trace-hook-epilogue-check=): Likewise.
(mtpf-trace-hook-epilogue-target=): Likewise.
* doc/invoke.texi (Option Summary) <S/390 and zSeries Options>:
Remove redundant -mno- entries and add missing options. Make
entries with arguments match the syntax in the main documentation.
(S/390 and zSeries Options): Light copy-editing. Wrap overly-long
lines. Add missing @opindex entries. Add documention for
-mmain, -mno-pic-data-is-text-relative, -mindirect-branch,
-mindirect-branch-jump, -mindirect-branch-call,
-mfunction-return, -mfunction-return-mem, -mfunction-return-reg,
-mindirect-branch-table, -mfentry, -mrecord-mcount, -mnop-mcount,
-mpreserve-args, and -munaligned-symbols.
Sandra Loosemore [Wed, 31 Dec 2025 16:28:38 +0000 (16:28 +0000)]
doc, rs6000: Clean up RS/6000 options documentation [PR122243]
Similar to other patches in this series, the focus is on ensuring all
options are either documented or marked "Undocumented", listed in both
the options summary and detailed documentation, and both positive and
negative forms have entries in the table of contents.
gcc/ChangeLog
PR other/122243
* config/rs6000/darwin.opt (Waltivec-long-deprecated): Mark as
Undocumented.
(faltivec, ffix-and-continue, findirect-data): Likewise.
* config/rs6000/rs6000.opt (mvrsave): Likewise.
* config/rs6000/sysv4.opt (mno-toc, mtoc, mno-traceback): Likewise.
(mshlib, mnewlib): Likewise.
* doc/invoke.texi (Option Summary) <RS/6000 and PowerPC Options>:
Document only one form of each option. Add missing options.
Correct whitespace.
(RS/6000 and PowerPC Options): Separately document -mpowerpc-gpopt,
-mpowerpc-gfxopt, -mpowerpc64, -mmfcrf, -mpopcntb, -mpopcntd,
-mfprnd, -mcmpb, and -mhard-dfp and move their documentation after
-mcpu=. Remove documentation for -mtoc which is unimplemented.
Add missing @opindex entries. Minor copy-editing and whitespace
fixes.
Sandra Loosemore [Sat, 27 Dec 2025 21:03:55 +0000 (21:03 +0000)]
doc, rl78: Clean up RL78 option documentation [PR122243] [PR71340]
This target is probably dead (no listed maintainer and no support for
LRA). There seems to be no interest in reviving the 2014 patch for
the documented but never-committed -m64bit-doubles and -m32bit-doubles
options, so I've removed those docs instead, along with some other
routine housekeeping to keep the docs in sync with the options file.
Jose E. Marchesi [Sat, 17 Jan 2026 20:56:20 +0000 (21:56 +0100)]
a68: add explicative comment to are_packs_equivalent
While fixing PR algol68/123653 I noticed that there was a struct mode
interned in the compiler with the form `struct (ref int)'. This is
odd because fields are supposed to have names in struct modes.
Jakub Jelinek [Sat, 17 Jan 2026 18:27:54 +0000 (19:27 +0100)]
Regenerate cobol lang.opt.urls
r16-6851 added -fexec-charset= option to cobol/lang.opt but hasn't
regenerated lang.opt.urls. While the other options don't match
anything, -fexec-charset= is C/C++ option.
Jose E. Marchesi [Sat, 17 Jan 2026 17:28:34 +0000 (18:28 +0100)]
a68: do not define Number and whole as built-ins
Now that we have the support of adding Algol 68 code to the run-time
library libga68, we are writing most of the Transput in Algol 68. In
particular, both the Number mode and the standard procedure `whole',
among others, are already implemented in transput.a68.in.
This patch removed remnant code that used to define these as compiler
built-ins.
Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog
* a68-parser-prelude.cc (stand_transput): Do not define
`Number' and `whole' as built-ins.
Jakub Jelinek [Sat, 17 Jan 2026 13:37:30 +0000 (14:37 +0100)]
tree: Handle ::operator {new,delete} function templates as uncertain matches [PR123513]
We have for some reason two different ways to check for matching
::operator new vs. ::operator delete kind. One is a dumb one in
tree.cc (valid_new_delete_pair_p) and another one is in
gimple-ssa-warn-access.cc (new_delete_mismatch_p).
The former is used both in the latter and in optimizations,
the latter only for warnings.
The former just handles the easy cases, global operator new and
the latter can handle everything as it uses the demangler.
The former has essentially a tri-state return even when it has just bool
return type, it has another bool * optional argument, so can return
true for this is definitely ok, false with false with this might be
not matching and false with true for this definitely doesn't match.
false with false is returned e.g. for the class scope operator new/delete,
where we definitely need the demangler to figure stuff out.
false with true is returned for mismatches which are guaranteed, e.g.
when one mangled name starts with _Znw and the other with _Zda,
one is ::operator new and the other is ::operator delete[].
valid_new_delete_pair_p expects that after the _Znw/_Zna/_Zdl/_Zda
prefix (or two _ at the start instead of one) it sees [jmy] for
the size_t argument resp. Pv for void* for delete, for delete
then optionally the same [jmy] for sized deallocation and
optionally RKSt9nothrow_t after it for nothrow versions or
also something with St11align_val_t. If it has some extra arguments
after it, it also returns false/false.
The following testcase shows another case where I'm afraid we need
to return the maybe mismatch - when the global operators are function
templates.
_ZnwILm1024EEPvmR13BumpAllocatorIXT_EE
_ZdlILm1024EEvPvR13BumpAllocatorIXT_EE
where the Ilm1024EE here mean <1024ul> and Pv after it means function
return type void *. As valid_new_delete_pair_p needs to find the m
after it, it would need to know everything about what can appear
in between I and E for the template arguments (which is a lot) and
also be able to skip over mangling of arbitrary function return types
(though perhaps it could hardcode those Pv vs. v cases for those).
So, the following patch just returns false/false instead of false/true
if known _Z{nw,na,dl,da} is followed by I, i.e. if it is a function
template. For optimizations it makes no difference, those care just
about the return value and not on *pcertain, and for the warning it
means it will use the demangler which will figure stuff hopefully right.
2026-01-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/123513
* tree.cc (valid_new_delete_pair_p): If new_name[3] or delete_name[3]
is 'I', return false with *pcertain set to false rather than true.
* g++.dg/warn/Wmismatched-new-delete-10.C: New test.
Nathaniel Shead [Fri, 16 Jan 2026 23:41:58 +0000 (10:41 +1100)]
c++/modules: Fix local type handling when not streaming function definitions [PR123627]
r14-9948-g716af95fd45487 added support for merging local types of
functions. This however causes the linked PR to crash, because when
restreaming the local type from a partition for the primary module
interface's CMI, we no longer have the DECL_INITIAL for a function.
This patch fixes the issue by reusing the MK_keyed merge kind, as used
for lambda types. This is required so that if a module partition
imports both the primary module interface and a different module
partition that both provide the same local type it can properly dedup
the declarations.
We only need to do this if !has_definition; in cases where a definition
is available we keep using the MK_local_type behaviour as that avoids
the need to maintain a separately allocated chain of keyed decls.
An additional change is to further the modifications made in r16-4671
and always attempt to key to the top-most decl, including going through
possibly many nested class and function definitions. This avoids any
similar issues to that bug where we read a keyed decl before we see the
decl it's keyed to now that we support keying to functions as well.
PR c++/123627
gcc/cp/ChangeLog:
* class.cc (finish_struct): Maybe key function-local types.
* module.cc (trees_out::get_merge_kind): Choose whether to use
MK_local_type or MK_keyed for a local type based on if the
immediate context's definition will be streamed.
(trees_in::key_mergeable): Allow key decls on FUNCTION_DECL.
(adjust_key_scope): New function.
(maybe_key_decl): Handle key decls on FUNCTION_DECL; check that
we only key a given decl to a context at most once.
(get_keyed_decl_scope): Support non-lambda decls.
gcc/testsuite/ChangeLog:
* g++.dg/modules/block-decl-4_a.C: New test.
* g++.dg/modules/block-decl-4_b.C: New test.
* g++.dg/modules/block-decl-4_c.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Jason Merrill <jason@redhat.com>
Robert Dubner [Fri, 16 Jan 2026 20:42:50 +0000 (15:42 -0500)]
cobol: Support National characters and Unicode runtime encoding.
The last few months have seen an evolution in the COBOL compiler. Up
until now it could use either CP1252/ASCII or CP1140/EBCDIC to represent
alphanumeric variables and numeric types that are stored as character
strings. With these changes, those types can be represented in many
other single-byte encodings, as well as UTF16 and UTF32 encodings.
These changes required extensive changes.
1) The initial parsing has to handle the extended capabilities.
2) Each run-time variable designates its character set.
3) The run-time code has to be able to handle wide characters.
Since the development took place over a period of time, other changes
crept in. In particular, there is an expansion of bindings making
certain POSIX functions available to the COBOL programmer.
There has also been an expansion of gcobol's use of the GCC diagnostic
framework.
Co-Authored-By: Robert Dubner <rdubner@symas.com> Co-Authored-By: James K. Lowden <jklowden@cobolworx.com>
gcc/cobol/ChangeLog:
* hierarchical_discriminator.cc (init_copyid_allocator): Walks the function
body to find existing max copyids per location.
(record_existing_copyid): New.
gccrs: Fix empty struct constructors causing ICE during type checking
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-expr.cc (visit(StructExprStruct)): Update to properly
unwrap enum variants for type checking.
* typecheck/rust-tyty.cc (VariantDef::get_fields) : Remove NUM assert.
* backend/rust-compile-expr.cc: Update to properly unwrap enum variants for type
resolution checking.
Jayant Chauhan [Tue, 6 Jan 2026 18:12:58 +0000 (23:42 +0530)]
gccrs: util/attributes: error on malformed #[no_mangle] input
Emit a diagnostic when #[no_mangle] is used with arguments,
matching rustc behavior. The no_mangle attribute is a word
attribute and should not accept any input values.
Jayant Chauhan [Tue, 6 Jan 2026 16:25:02 +0000 (21:55 +0530)]
gccrs: util/attributes: error on malformed #[target_feature] input
Emit a diagnostic when #[target_feature] is used without arguments,
matching rustc behavior. This prevents silent acceptance of empty
attributes and provides a helpful diagnostic that shows the expected form.
Jayant Chauhan [Sat, 3 Jan 2026 23:36:53 +0000 (05:06 +0530)]
gccrs: util/attributes: error on malformed #[link_name] input
Emit a diagnostic when #[link_name] is used without arguments,
matching rustc behavior. This prevents silent acceptance of empty
attributes and provides a helpful diagnostic that shows the expected form.
Arthur Cohen [Fri, 12 Sep 2025 14:11:15 +0000 (16:11 +0200)]
gccrs: nr: Do prelude resolution for Identifiers
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: New function.
* resolve/rust-forever-stack.hxx: Implement it.
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Call it if the prelude exists
and we have an unresolved Identifier Call it if the prelude exists and we have
an unresolved Identifier.
Arthur Cohen [Wed, 10 Sep 2025 07:07:55 +0000 (09:07 +0200)]
gccrs: nr: Add prelude field to NRCtx, and fill it upon encountering a prelude.
gcc/rust/ChangeLog:
* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_glob_import): Save prelude
if we find one.
* resolve/rust-name-resolution-context.h: Add field.
* resolve/rust-toplevel-name-resolver-2.0.cc (has_prelude_import): New function.
(TopLevel::visit): Create a prelude glob import if necessary.
* resolve/rust-toplevel-name-resolver-2.0.h: Allow glob imports to be prelude imports.
gccrs: Move old parser error classes to error header
A parser error header with Parse::Error namespace has recently been
introduced. Move some old parser error classes to this namespace.
gcc/rust/ChangeLog:
* parse/rust-parse.h (class ParseLifetimeParamError): Move error from
here ...
(class ParseLifetimeError): Likewise.
(enum class): Likewise.
* parse/rust-parse-error.h (class LifetimeParam): ... to here.
here.
(class Lifetime): Likewise.
(enum class): Likewise.
(struct LoopLabel): Likewise and make it a full struct with ctors.
(struct Self): Likewise.
* parse/rust-parse-impl-expr.hxx: Make error point to new namespace.
* parse/rust-parse-impl.hxx: Likewise.
Harishankar [Thu, 1 Jan 2026 05:17:23 +0000 (10:47 +0530)]
gccrs: Fix rogue macro error during lowering on expansion failure
When a macro expansion fails (e.g. due to a parsing error like invalid
syntax in the macro body), the expander previously returned an error
fragment but did not update the AST. This left the original macro
invocation in place, which subsequently caused an ICE (rogue macro
detected) during the lowering phase.
This patch updates `expand_invoc` to replace the macro invocation with
an empty fragment if expansion fails, ensuring the compiler can proceed
(or exit gracefully) without crashing.
Fixes Rust-GCC/gccrs#4213
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Handle
error fragments by replacing them with empty fragments.
David Malcolm [Fri, 16 Jan 2026 15:54:32 +0000 (10:54 -0500)]
analyzer: fix check against --param=analyzer-bb-explosion-factor=0
analyzer.texi documents --param=analyzer-bb-explosion-factor=0 as a way
to make the analysis bail out early, but I broke this in r16-6063-g0b786d961d4426.
Fix thusly.
gcc/analyzer/ChangeLog:
* engine.cc (exploded_graph::process_worklist): Remove guard on
limit being non-zero when checking for -Wanalyzer-too-complex
on overall number of exploded nodes. Allow for the origin enode.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 16 Jan 2026 15:54:31 +0000 (10:54 -0500)]
analyzer: add timevar values for supergraph manipulation [PR123145]
Whilst tracking down the slowdown of PR analyzer/123145, I noticed that
the various supergraph manipulations introduced in r16-6063-g0b786d961d4426 can take non-trivial amounts of time on
complicated TUs. Add timevars to track each of them.
gcc/analyzer/ChangeLog:
PR analyzer/123145
* supergraph-fixup-locations.cc: Include "timevar.h".
(supergraph::fixup_locations): Track time spent as
TV_ANALYZER_SUPERGRAPH_FIXUP_LOCATIONS.
* supergraph-simplify.cc: Include "timevar.h".
(supergraph::simplify): Track time spent as
TV_ANALYZER_SUPERGRAPH_SIMPLIFY.
* supergraph-sorting.cc: Include "timevar.h".
(supergraph::sort_nodes): Track time spent as
TV_ANALYZER_SUPERGRAPH_SORTING.
* supergraph.cc (supergraph::supergraph): Track time spent as
TV_ANALYZER_SUPERGRAPH_CREATION rather than
TV_ANALYZER_SUPERGRAPH.
[PR123092, LRA]: Reprocess insn after equivalence substitution
LRA in the test case substituted equivalence in an insn but did not
process the insn on satisfying constraints after that. It resulted in
error "insn does not satisfy its constraints"
gcc/ChangeLog:
PR target/123092
* lra-constraints.cc (lra_constraints): Push insn on processing
stack after equivalence substitution.
This can easily be fixed by implementing the
host_hooks.gt_pch_get_address hook. The code is shamelessly stolen from
the openbsd implementation, only changing the names and omitting the
hppa and i386 code. The former isn't supported by FreeBSD at all AFAIK,
while the latter has just been removed in FreeBSD 15.0.
Bootstrapped without regressions on x86_64-unknown-freebsd14.3: all PCH
failures are gone.
Martin Jambor [Fri, 16 Jan 2026 11:04:23 +0000 (12:04 +0100)]
ipa-cp: Fix devirt bonus for targets that cannot be inlined
PR 123412 has been filed because since commit r16-3990-gad3fb999a1b568 (Jan Hubicka: Improve ipa-cp devirtualization
costing), there is accidentally zero devirtualization bonus for
functions which cannot be inlined. This has resulted in
g++.dg/ipa/devirt-2.C failing since it has been pushed because the
required function is not cloned even with --param max-devirt-targets=1.
The intention was that we do get at least some small benefit boost and
so this patch adds an addition of the indirect edge frequency once
before the early continue statements.
gcc/ChangeLog:
2026-01-14 Martin Jambor <mjambor@suse.cz>
PR ipa/123412
* ipa-cp.cc (devirtualization_time_bonus): Do add the indirect
edge frequency at least once even for targets which cannot be
inlined.
To my surprise we accept generic vectors with enumeral element
types (unlike e.g. _Complex) and we don't actually try to
perform "integral" promotions for those either (which for scalars
promotes ENUMERAL_TYPE operands to their underlying type or
promoted underlying type). I'm afraid it is inappropriate
to change the promotions at this point in stage4, that would
be a significant user visible change (though sure for a feature
that hopefully nobody actually uses). Anyway, in GCC 16
development some assertions that RDIV_EXPR is only used for floating
(scalar/vector/complex) operands were added and those now trigger
on trying to divide vectors where both operands are enum vectors.
THis is due to the FEs using RDIV_EXPR instead of TRUNC_DIV_EXPR
when the operands (after promotions) don't have INTEGER_TYPE (or for C
BITINT_TYPE) operands.
This patch just adds vector enum to that.
2026-01-16 Jakub Jelinek <jakub@redhat.com>
Peter Damianov <peter0x44@disroot.org>
PR c/123437
* c-typeck.cc (build_binary_op): Don't use RDIV_EXPR
resultcode if both types are integral, _BitInt or
newly VECTOR_TYPE of ENUMERAL_TYPE.
* typeck.cc (cp_build_binary_op): Don't use RDIV_EXPR
resultcode if both types are integral, _BitInt or
newly VECTOR_TYPE of ENUMERAL_TYPE.
Jakub Jelinek [Fri, 16 Jan 2026 07:22:32 +0000 (08:22 +0100)]
i386: Fix up movhf_mask constraints [PR123607]
As documented in the manuals and enforced by gas,
VMOVSH two operand loads and three operands moves accept both
masking and masking/zeroing, but VMOVSH two operand store accepts
only masking:
EVEX.LLIG.F3.MAP5.W0 10 /r VMOVSH xmm1{k1}{z}, m16
EVEX.LLIG.F3.MAP5.W0 11 /r VMOVSH m16{k1}, xmm1
EVEX.LLIG.F3.MAP5.W0 10 /r VMOVSH xmm1{k1}{z}, xmm2, xmm3
EVEX.LLIG.F3.MAP5.W0 11 /r VMOVSH xmm1{k1}{z}, xmm2, xmm3
But the constraints in movhf_mask define_insn were allowing 0C
for all the alternatives. The following patch enforces just 0
(i.e. just non-zeroing masking) for the second alternative (i.e.
the store).
2026-01-16 Jakub Jelinek <jakub@redhat.com>
PR target/123607
* config/i386/i386.md (movhf_mask): Change constraint on
match_operand 2's second alternative from 0C to 0.
* g++.target/i386/avx512fp16-pr123607.C: New test.
Lulu Cheng [Mon, 12 Jan 2026 09:23:41 +0000 (17:23 +0800)]
LoongArch: Fix bug123521.
In the vector initialization process, optimization can be performed
if it can be determined that all elements are the same, or if the
upper or lower halves are identical. However, during this
optimization, when the identical element is an immediate value
larger than 10 bits, an internal compiler error (ICE) occurs.
The reason is that in such cases, the function
`simplify_gen_subreg (imode, reg_tmp, GET_MODE (reg_tmp), 0)` is
called, where `imode` is `E_DImode`. The mode of `reg_tmp` in
`GET_MODE (reg_tmp)` is taken from the immediate value's mode,
which is `E_VOIDmode`. This results in a move from `E_VOIDmode`
to `E_DImode`, an operation not supported by LoongArch.
PR target/123521
gcc/ChangeLog:
* config/loongarch/loongarch.cc
(loongarch_expand_vector_init_same): Fixed a bug in the
vector initialization section..
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/vector/lasx/pr123521.c: New test.
Jeff Law [Thu, 15 Jan 2026 19:49:55 +0000 (12:49 -0700)]
Fix RISC-V test after recent vectorizer changes
Richi's patch to fix costing of permuted contiguous loads changed the code
generation for pr122445.c in the testsuite. After reviewing the code, it looks
clearly better to me -- essentially covering 2X as many elements per vector op
with fewer total vector ops in the end (without resulting to LMUL > 1).
I've verified this fixes the overnight regressions seen on riscv{32,64}-elf.
The bootstrap and regression tests are in flight, but won't finish for many
more hours.
Jakub Jelinek [Thu, 15 Jan 2026 15:34:14 +0000 (16:34 +0100)]
libstdc++: Fix __cpp_impl_reflection comparisons
Last night when applying Marek's patchset for testing I've noticed I forgot
to change these 5 spots when changing the -freflection -std=c++26 predefined
value from 202500 which meant we implement some reflection, but not the
whole paper, to 202506 which is the https://eel.is/c++draft/tab:cpp.predefined.ft
value for it.
Marek Polacek [Wed, 14 Jan 2026 16:37:39 +0000 (11:37 -0500)]
c++: C++26 Reflection [PR120775]
This patch implements C++26 Reflection as specified by P2996R13, which allows
users to perform magic. This patch also implements related papers:
Annotations for Reflection (P3394R4),
Splicing a base class subobject (P3293R3),
define_static_{string,object,array} (P3491R3),
Function Parameter Reflection (P3096R12).
(I already implemented consteval blocks back in July.)
(We do not yet implement P3795.)
We also implemented some CWG issues that had been approved in Kona;
e.g., CWG 3101, 3109, 3111, 3115, 3117.
All metafunctions are implemented in this patch.
The feature needs to be enabled by -std=c++26 -freflection.
Some stats: the v1 patch was over 51,200 LOC which were written in ~335
commits. It came with over 400 tests with 11,722 static_asserts. We still
had about 50 TODOs and FIXMEs in the code.
v2 consists of about 56,000 LOC which were created in 440 commits. We
now have 446 tests with 40 TODOs remaining.
v3 brought another 77 commits, mostly clean-ups and various bug fixes.
I'd like to thank:
Jakub Jelinek, whose efforts can only be described as heroic and who
never ceases to amaze me even after nearly 15 years of working together,
he implemented many difficult metafunctions, annotations, mangling,
converted our metafunction dispatch to using gperf, and so on and on;
Jonathan Wakely for his libstdc++ patch review and generous & impeccable
advice even at odd hours; Dan Katz for his work on the Reflection papers,
writing Reflection tests for clang++ (many of which I've stolen^Wused),
for his advice, bug reports, and generally cheering me on; Jason Merrill
for his guidance, patch review, and, in fact, encouraging me to take on
this project in the first place; Michael Levine, Valentyn Yukhymenko, and
Alex Yesmanchyk for their nice contributions to Reflection; and Tomasz
Kamiński for providing test cases, finding bugs, and answering my C++
questions.
PR c++/120775
PR c++/123081
PR c++/122634
gcc/ChangeLog:
* attribs.cc (attribute_value_equal): Return false if either attribute
is ATTR_UNIQUE_VALUE_P.
(merge_attributes): Handle lists with ATTR_UNIQUE_VALUE_P values.
* doc/invoke.texi: Document -freflection.
* dwarf2out.cc (is_base_type) <case default>: Check
TREE_CODE >= LAST_AND_UNUSED_TREE_CODE instead of is_cxx_auto.
(gen_type_die_with_usage): For TREE_CODE >= LAST_AND_UNUSED_TREE_CODE
trees use use DW_TAG_unspecified_type.
* tree-core.h (struct tree_base): Update a comment.
* tree.h (ATTR_UNIQUE_VALUE_P): Define.
(BINFO_BASE_ACCESSES): Update the comment.
* Make-lang.in: Add cp/reflect.o. Add a rule for cp/metafns.h.
* config-lang.in: Add reflect.cc.
* constexpr.cc (constexpr_global_ctx): Add consteval_block and
metafns_called members. Initialize them.
(cxx_constexpr_quiet_p): New.
(cxx_constexpr_manifestly_const_eval): New.
(cxx_constexpr_caller): New.
(cxx_constexpr_consteval_block): New.
(enum value_cat): Move into cp-tree.h.
(cxx_eval_constant_expression): Move the declaration into cp-tree.h.
No longer static. Handle REFLECT_EXPR. Handle conversion of
a reflection to the meta::info type.
(cxx_eval_cxa_builtin_fn): Override current_function_decl.
(cxx_eval_builtin_function_call): Handle __builtin_is_string_literal.
(is_std_allocator): Also check __new_allocator.
(is_std_allocator_allocate): No longer static.
(cxa_allocate_and_throw_exception): New.
(cxx_eval_call_expression): Handle metafunctions. Maybe set
metafns_called.
(reduced_constant_expression_p): Handle REFLECT_EXPR.
(cxx_eval_binary_expression): Use compare_reflections for comparing
reflections.
(find_immediate_fndecl): Don't walk REFLECT_EXPR_P.
(cxx_eval_outermost_constant_expr): Set global_ctx.consteval_block.
Detect consteval-only smuggling.
(potential_constant_expression_1): Return true for REFLECT_EXPR
and SPLICE_EXPR.
* constraint.cc (diagnose_trait_expr): Add CPTK_IS_CONSTEVAL_ONLY case.
* cp-gimplify.cc (immediate_escalating_function_p): No longer static.
(promote_function_to_consteval): Likewise.
(cp_gimplify_expr) <case CALL_EXPR>: Detect any surviving consteval-only
expressions.
<case CP_BUILT_IN_IS_STRING_LITERAL>: Handle.
(wipe_consteval_only_r): New.
(cp_fold_immediate_r): Detect invalid uses of consteval-only types.
Clear consteval-only DECL_EXPRs.
(cp_genericize_r): Wipe consteval-only vars from BIND_EXPR_VARS and
BLOCK_VARS.
* cp-objcp-common.cc (cp_common_init_ts): Mark META_TYPE, SPLICE_SCOPE,
SPLICE_EXPR, and REFLECT_EXPR.
* cp-trait.def (IS_CONSTEVAL_ONLY): New trait.
* cp-tree.def (REFLECT_EXPR, META_TYPE, SPLICE_EXPR, SPLICE_SCOPE): New
trees.
* cp-tree.h (enum cp_tree_index): Add CPTI_ANNOTATION_IDENTIFIER,
CPTI_STD_META, and CPTI_META_INFO_TYPE.
(std_meta_node): Define.
(meta_info_type_node): Define.
(annotation_identifier): Define.
(REFLECTION_TYPE_P): Define.
(REFLECT_EXPR_P): Define.
(REFLECT_EXPR_HANDLE): Define.
(enum reflect_kind): New.
(REFLECT_EXPR_KIND): Define.
(SET_REFLECT_EXPR_KIND): Define.
(SPLICE_EXPR_EXPRESSION_P): Define.
(SET_SPLICE_EXPR_EXPRESSION_P): Define.
(SPLICE_EXPR_MEMBER_ACCESS_P): Define.
(SET_SPLICE_EXPR_MEMBER_ACCESS_P): Define.
(SPLICE_EXPR_ADDRESS_P): Define.
(SET_SPLICE_EXPR_ADDRESS_P): Define.
(SPLICE_SCOPE_EXPR): Define.
(SPLICE_SCOPE_TYPE_P): Define.
(WILDCARD_TYPE_P): Include SPLICE_SCOPE.
(COMPONENT_REF_SPLICE_P): Define.
(SCALAR_TYPE_P): Include REFLECTION_TYPE_P.
(ENUM_BEING_DEFINED_P): Define.
(OLD_PARM_DECL_P): Define.
(MULTIPLE_NAMES_PARM_P): Define.
(cp_preserve_using_decl): Declare.
(DEF_OPERATOR, DEF_ASSN_OPERATOR): Include META.
(struct ovl_op_info_t): Add meta_name member.
(enum cp_built_in_function): Add CP_BUILT_IN_IS_STRING_LITERAL.
(build_stub_type): Declare.
(current_function_decl_without_access_scope): Declare.
(dependent_namespace_p): Declare.
(convert_reflect_constant_arg): Declare.
(finish_base_specifier): Adjust declaration.
(parsing_lambda_declarator): Declare.
(fold_builtin_is_string_literal): Declare.
(annotation_p): Declare.
(finish_class_member_access_expr): Adjust declaration.
(immediate_escalating_function_p): Declare.
(promote_function_to_consteval): Declare.
(is_std_allocator_allocate): Declare.
(cxa_allocate_and_throw_exception): Declare.
(enum value_cat): Define.
(cxx_eval_constant_expression): Declare.
(cxx_constexpr_quiet_p): Declare.
(cxx_constexpr_manifestly_const_eval): Declare.
(cxx_constexpr_caller): Declare.
(cxx_constexpr_consteval_block): Declare.
(init_reflection): Declare.
(metafunction_p): Declare.
(direct_base_parent): Declare.
(process_metafunction): Declare.
(get_reflection): Declare.
(get_null_reflection): Declare.
(splice): Declare.
(check_out_of_consteval_use): Declare.
(consteval_only_p): Declare.
(compare_reflections): Declare.
(valid_splice_type_p): Declare.
(valid_splice_scope_p): Declare.
(check_splice_expr): Declare.
(make_splice_scope): Declare.
(dependent_splice_p): Declare.
(reflection_mangle_prefix): Declare.
(check_consteval_only_fn): Declare.
* cvt.cc (convert_to_void): Call check_out_of_consteval_use.
* cxx-pretty-print.cc (cxx_pretty_printer::unary_expression): New
REFLECT_EXPR case.
(cxx_pretty_printer::expression): Likewise.
(cxx_pretty_printer::simple_type_specifier): New META_TYPE case.
(cxx_pretty_printer::type_id): Likewise.
* decl.cc (duplicate_decls): Merge parameter names for Reflection.
Maybe set OLD_PARM_DECL_P.
(initialize_predefined_identifiers): Add "annotation ".
(cxx_init_decl_processing): Add __builtin_is_string_literal. Call
init_reflection.
(maybe_commonize_var): Do nothing for consteval_only_p.
(check_initializer): Default-initialize std::meta::info.
(make_rtl_for_nonlocal_decl): For consteval_only_p vars, set
DECL_EXTERNAL and return early.
(cp_finish_decl): Call check_out_of_consteval_use. Don't go
creating a varpool node for consteval_only_p.
(get_tuple_size): Check the instantiation instead of the type.
(grokfndecl): Call check_consteval_only_fn.
(xref_basetypes): Stitch annotations onto BINFO_BASE_ACCESSES.
(finish_enum_value_list): Clear ENUM_BEING_DEFINED_P.
* decl2.cc (is_late_template_attribute): Handle all annotations as
late.
(cp_check_const_attributes): Don't handle annotations here.
(maybe_make_one_only): Do nothing for consteval_only_p.
(mark_needed): Likewise.
(min_vis_expr_r): Handle reflections.
(prune_vars_needing_no_initialization): Skip consteval_only_p.
(no_linkage_error): Return early for metafunctions.
(c_parse_final_cleanups): Don't write out consteval_only_p vars. Avoid
complaining about metafunctions.
* error.cc (dump_type): New cases for CONST_DECL, META_TYPE, and
SPLICE_SCOPE.
(dump_type_prefix): New cases for META_TYPE and SPLICE_SCOPE.
(dump_type_suffix): Likewise.
(dump_decl): Dump SPLICE_EXPR.
(dump_expr): Dump REFLECT_EXPR and SPLICE_EXPR.
* init.cc (build_zero_init_1): Build a null reflection value.
(perform_member_init): Call check_out_of_consteval_use.
* lex.cc (DEF_OPERATOR, OPERATOR_TRANSITION): Update defines.
* mangle.cc (write_type): Mangle META_TYPE.
(write_expression): Handle REFLECT_EXPR.
(write_reflection): New.
(write_template_arg_literal): New REFLECT_EXPR case.
(write_template_arg): Handle REFLECT_EXPR.
* method.cc (build_stub_type): No longer static.
* module.cc (trees_out::type_node): Handle META_TYPE.
(trees_in::tree_node): Likewise.
* name-lookup.cc (name_lookup::adl_type): std::meta is an associated
namespace of std::meta::info.
(strip_using_decl): Don't strip when cp_preserve_using_decl.
(handle_namespace_attrs): Handle annotations.
(do_namespace_alias): Handle SPLICE_EXPR.
(lookup_qualified_name): When cp_preserve_using_decl, don't do
OVL_FUNCTION.
(finish_using_directive): Detect annotations on using directive.
* operators.def: Update for META_NAME.
* parser.cc: New cp_preserve_using_decl global.
(enum required_token): Add RT_CLOSE_SPLICE.
(get_required_cpp_ttype): Return CPP_CLOSE_SPLICE for RT_CLOSE_SPLICE.
(cp_parser_next_tokens_start_splice_type_spec_p): New.
(cp_parser_next_tokens_can_start_splice_scope_spec_p): New.
(cp_parser_splice_specifier): New.
(cp_parser_splice_type_specifier): New.
(cp_parser_splice_expression): New.
(cp_parser_splice_scope_specifier): New.
(cp_parser_splice_spec_is_nns_p): New.
(cp_parser_nth_token_starts_splice_without_nns_p): New.
(cp_parser_primary_expression): Handle CPP_OPEN_SPLICE. Give an
error for ^^ outside reflection.
(cp_parser_unqualified_id): Allow r.~typename [:R:].
(cp_parser_nested_name_specifier_opt): Cope with splice-scope-specifier.
(cp_parser_qualifying_entity): Parse splice-scope-specifier.
(cp_parser_postfix_expression): Deal with [: :] after a typename.
(cp_parser_postfix_dot_deref_expression): Parse & handle splices
in a class member access. Pass splice_p to
finish_class_member_access_expr.
(cp_parser_reflection_name): New.
(cp_parser_reflect_expression): New.
(cp_parser_unary_expression): Parse reflect-expression.
(cp_parser_declaration): Parse splice-scope-specifier.
(cp_parser_decomposition_declaration): Detect annotations on structured
bindings.
(cp_parser_decltype_expr): Parse splice-expression.
(cp_parser_template_id): New parsed_templ argument. If it's nonnull,
don't parse the template name. Turn an assert into a condition.
(cp_parser_type_specifier): Handle typename [: :].
(cp_parser_simple_type_specifier): Parse splice-type-specifier.
(cp_parser_enum_specifier): Set ENUM_BEING_DEFINED_P.
(cp_parser_namespace_alias_definition): Parse splice-specifier.
(cp_parser_using_directive): Likewise.
(cp_parser_type_id_1): New bool * parameter to distinguish between
types and type aliases. Set it.
(cp_parser_type_id): Adjust the call to cp_parser_type_id_1.
(cp_parser_template_type_arg): Likewise.
(cp_parser_trailing_type_id): Likewise.
(cp_parser_base_specifier): Handle annotations. Maybe give an error
for splice-scope-specifier. Parse splice-type-specifier. Pass
annotations to finish_base_specifier.
(cp_parser_annotation): New.
(cp_parser_std_attribute_list): Detect mixing annotations and attributes
in the same list.
(cp_parser_annotation_list): New.
(cp_parser_std_attribute_spec): Parse annotations.
(cp_parser_skip_balanced_tokens): Also handle CPP_OPEN_SPLICE
and CPP_CLOSE_SPLICE.
(cp_parser_type_requirement): Parse splice-type-specifier.
(cp_parser_lookup_name): Also consider dependent namespaces. Don't
call check_accessibility_of_qualified_id for USING_DECLs.
(cp_parser_required_error): Handle RT_CLOSE_SPLICE.
* pt.cc (current_function_decl_without_access_scope): New.
(verify_unstripped_args_1): REFLECT_EXPR_P is OK.
(iterative_hash_template_arg): Handle REFLECT_EXPR.
(convert_nontype_argument): Maybe give an error for REFLECTION_TYPE_P.
(for_each_template_parm_r): Handle SPLICE_SCOPE.
(instantiate_class_template): Handle annotations.
(tsubst_pack_index): Make static.
(tsubst_decl): Handle NAMESPACE_DECL.
(tsubst_splice_scope): New.
(tsubst_splice_expr): New.
(tsubst): Don't return early for NAMESPACE_DECL. New META_TYPE case.
Handle a splice-specifier that expanded into a NAMESPACE_DECL. Handle
SPLICE_SCOPE, SPLICE_EXPR, and TEMPLATE_ID_EXPR.
(tsubst_scope): Also accept NAMESPACE_DECL.
(tsubst_qualified_id): Check dependent_namespace_p.
(tsubst_lambda_expr): Set LAMBDA_EXPR_CONSTEVAL_BLOCK_P.
(tsubst_expr): Allow dependent_splice_p in an assert. Check
COMPONENT_REF_SPLICE_P and pass it to finish_class_member_access_expr.
<case NAMESPACE_DECL>: Remove.
New REFLECT_EXPR and SPLICE_EXPR cases.
(unify): Handle META_TYPE.
(instantiate_body): Call check_consteval_only_fn.
(tsubst_enum): Set ENUM_BEING_DEFINED_P.
(dependent_type_p_r): A splice-scope-specifier is dependent.
(dependent_namespace_p): New.
(value_dependent_expression_p): Handle REFLECT_EXPR. Also handle
[meta.reflection.access.context]/8.
(type_dependent_expression_p): REFLECT_EXPR_P is not type-dependent.
(convert_reflect_constant_arg): New.
* search.cc (check_final_overrider): Adjust for CWG 3117.
* semantics.cc (finish_base_specifier): Handle annotations.
(parsing_lambda_declarator): No longer static.
(finish_id_expression_1): Check dependent_namespace_p.
(fold_builtin_is_string_literal): New.
(trait_expr_value): Handle CPTK_IS_CONSTEVAL_ONLY.
(finish_trait_expr): Likewise.
* tree.cc (handle_annotation_attribute): New.
(builtin_valid_in_constant_expr_p): Return true for
CP_BUILT_IN_IS_STRING_LITERAL.
(cp_tree_equal): Handle comparing REFLECT_EXPRs.
(internal_attributes): Add "annotation ".
(annotation_p): New.
* typeck.cc (finish_class_member_access_expr): New splice_p argument.
Handle dependent splices. Implement splicing a base class subobject.
Handle class member access using a splice-expression.
(cp_build_binary_op): Handle comparing std::meta::infos.
(check_return_expr): Call check_out_of_consteval_use.
* metafns.gperf: New file.
* metafns.h: New file.
* reflect.cc: New file.
libcc1/ChangeLog:
* libcp1plugin.cc (start_class_def): Update the call to
finish_base_specifier.
libcpp/ChangeLog:
* charset.cc (_cpp_destroy_iconv): Destroy narrow_cset_desc and
utf8_cset_desc.
(cpp_translate_string): New.
(cpp_valid_identifier): New.
* include/cpplib.h: Add OPEN_SPLICE, CLOSE_SPLICE, and REFLECT_OP to
TTYPE_TABLE.
(cpp_translate_string): Declare.
(cpp_valid_identifier): Declare.
* internal.h (struct cpp_reader): Add reverse_narrow_cset_desc and
reverse_utf8_cset_desc fields.
* lex.cc (_cpp_lex_direct): Emit CPP_CLOSE_SPLICE, CPP_REFLECT_OP,
and CPP_OPEN_SPLICE tokens.
libstdc++-v3/ChangeLog:
* include/Makefile.am (std_headers): Add ${std_srcdir}/meta.
* include/Makefile.in: Regenerate.
* include/bits/iterator_concepts.h (std::ranges::__access::__begin): Add
constexpr.
* include/bits/version.def (reflection): New.
* include/bits/version.h: Regenerate.
* include/precompiled/stdc++.h: Include <meta> for C++26.
* include/std/meta: New file.
* include/std/type_traits (std::is_reflection): New trait.
(std::is_fundamental): Include is_reflection for C++26 -freflection.
(std::is_reflection_v): New variable template.
(std::is_consteval_only): New trait.
(std::is_consteval_only_v): New variable template.
* src/c++23/std.cc.in: Add <meta> exports.
* testsuite/20_util/variable_templates_for_traits.cc: Add -freflection as
dg-additional-options for C++26. Add std::is_reflection_v test in that case.
* testsuite/20_util/is_consteval_only/requirements/explicit_instantiation.cc: New test.
* testsuite/20_util/is_consteval_only/requirements/typedefs.cc: New test.
* testsuite/20_util/is_consteval_only/value.cc: New test.
* testsuite/20_util/is_reflection/requirements/explicit_instantiation.cc: New test.
* testsuite/20_util/is_reflection/requirements/typedefs.cc: New test.
* testsuite/20_util/is_reflection/value.cc: New test.
gcc/testsuite/ChangeLog:
* g++.dg/DRs/dr2581-1.C: Add -freflection.
* g++.dg/DRs/dr2581-2.C: Likewise.
* g++.dg/reflect/access_context1.C: New test.
* g++.dg/reflect/access_context2.C: New test.
* g++.dg/reflect/access_context3.C: New test.
* g++.dg/reflect/adl1.C: New test.
* g++.dg/reflect/alignment_of1.C: New test.
* g++.dg/reflect/alignment_of2.C: New test.
* g++.dg/reflect/annotations1.C: New test.
* g++.dg/reflect/annotations2.C: New test.
* g++.dg/reflect/annotations3.C: New test.
* g++.dg/reflect/annotations4.C: New test.
* g++.dg/reflect/annotations5.C: New test.
* g++.dg/reflect/annotations6.C: New test.
* g++.dg/reflect/annotations7.C: New test.
* g++.dg/reflect/annotations8.C: New test.
* g++.dg/reflect/anon1.C: New test.
* g++.dg/reflect/anon2.C: New test.
* g++.dg/reflect/anon3.C: New test.
* g++.dg/reflect/bases_of1.C: New test.
* g++.dg/reflect/bases_of2.C: New test.
* g++.dg/reflect/bases_of3.C: New test.
* g++.dg/reflect/bit_size_of1.C: New test.
* g++.dg/reflect/bitfield1.C: New test.
* g++.dg/reflect/can_substitute1.C: New test.
* g++.dg/reflect/class1.C: New test.
* g++.dg/reflect/class2.C: New test.
* g++.dg/reflect/common_reference1.C: New test.
* g++.dg/reflect/common_type1.C: New test.
* g++.dg/reflect/compare1.C: New test.
* g++.dg/reflect/compare10.C: New test.
* g++.dg/reflect/compare2.C: New test.
* g++.dg/reflect/compare3.C: New test.
* g++.dg/reflect/compare4.C: New test.
* g++.dg/reflect/compare5.C: New test.
* g++.dg/reflect/compare6.C: New test.
* g++.dg/reflect/compare7.C: New test.
* g++.dg/reflect/compare8.C: New test.
* g++.dg/reflect/compare9.C: New test.
* g++.dg/reflect/compat1.C: New test.
* g++.dg/reflect/complete1.C: New test.
* g++.dg/reflect/constant_of1.C: New test.
* g++.dg/reflect/constant_of2.C: New test.
* g++.dg/reflect/constant_of3.C: New test.
* g++.dg/reflect/constant_of4.C: New test.
* g++.dg/reflect/constant_of5.C: New test.
* g++.dg/reflect/constant_of6.C: New test.
* g++.dg/reflect/constant_of7.C: New test.
* g++.dg/reflect/constant_of8.C: New test.
* g++.dg/reflect/constant_of9.C: New test.
* g++.dg/reflect/crash1.C: New test.
* g++.dg/reflect/crash10.C: New test.
* g++.dg/reflect/crash11.C: New test.
* g++.dg/reflect/crash12.C: New test.
* g++.dg/reflect/crash13.C: New test.
* g++.dg/reflect/crash14.C: New test.
* g++.dg/reflect/crash15.C: New test.
* g++.dg/reflect/crash16.C: New test.
* g++.dg/reflect/crash17.C: New test.
* g++.dg/reflect/crash18.C: New test.
* g++.dg/reflect/crash2.C: New test.
* g++.dg/reflect/crash3.C: New test.
* g++.dg/reflect/crash4.C: New test.
* g++.dg/reflect/crash5.C: New test.
* g++.dg/reflect/crash6.C: New test.
* g++.dg/reflect/crash7.C: New test.
* g++.dg/reflect/crash8.C: New test.
* g++.dg/reflect/crash9.C: New test.
* g++.dg/reflect/data_member_spec1.C: New test.
* g++.dg/reflect/data_member_spec2.C: New test.
* g++.dg/reflect/data_member_spec3.C: New test.
* g++.dg/reflect/data_member_spec4.C: New test.
* g++.dg/reflect/dealias1.C: New test.
* g++.dg/reflect/dealias2.C: New test.
* g++.dg/reflect/dealias3.C: New test.
* g++.dg/reflect/define_aggregate1.C: New test.
* g++.dg/reflect/define_aggregate2.C: New test.
* g++.dg/reflect/define_aggregate3.C: New test.
* g++.dg/reflect/define_aggregate4.C: New test.
* g++.dg/reflect/define_aggregate5.C: New test.
* g++.dg/reflect/define_static_array1.C: New test.
* g++.dg/reflect/define_static_array2.C: New test.
* g++.dg/reflect/define_static_array3.C: New test.
* g++.dg/reflect/define_static_array4.C: New test.
* g++.dg/reflect/define_static_object1.C: New test.
* g++.dg/reflect/define_static_object2.C: New test.
* g++.dg/reflect/define_static_string1.C: New test.
* g++.dg/reflect/dep1.C: New test.
* g++.dg/reflect/dep10.C: New test.
* g++.dg/reflect/dep11.C: New test.
* g++.dg/reflect/dep2.C: New test.
* g++.dg/reflect/dep3.C: New test.
* g++.dg/reflect/dep4.C: New test.
* g++.dg/reflect/dep5.C: New test.
* g++.dg/reflect/dep6.C: New test.
* g++.dg/reflect/dep7.C: New test.
* g++.dg/reflect/dep8.C: New test.
* g++.dg/reflect/dep9.C: New test.
* g++.dg/reflect/diag1.C: New test.
* g++.dg/reflect/diag2.C: New test.
* g++.dg/reflect/diag3.C: New test.
* g++.dg/reflect/diag4.C: New test.
* g++.dg/reflect/display_string_of1.C: New test.
* g++.dg/reflect/eh1.C: New test.
* g++.dg/reflect/eh2.C: New test.
* g++.dg/reflect/eh3.C: New test.
* g++.dg/reflect/eh4.C: New test.
* g++.dg/reflect/eh5.C: New test.
* g++.dg/reflect/eh6.C: New test.
* g++.dg/reflect/eh7.C: New test.
* g++.dg/reflect/eh8.C: New test.
* g++.dg/reflect/eh9.C: New test.
* g++.dg/reflect/enumerators_of1.C: New test.
* g++.dg/reflect/error1.C: New test.
* g++.dg/reflect/error10.C: New test.
* g++.dg/reflect/error2.C: New test.
* g++.dg/reflect/error3.C: New test.
* g++.dg/reflect/error4.C: New test.
* g++.dg/reflect/error5.C: New test.
* g++.dg/reflect/error6.C: New test.
* g++.dg/reflect/error8.C: New test.
* g++.dg/reflect/error9.C: New test.
* g++.dg/reflect/expr1.C: New test.
* g++.dg/reflect/expr10.C: New test.
* g++.dg/reflect/expr11.C: New test.
* g++.dg/reflect/expr12.C: New test.
* g++.dg/reflect/expr13.C: New test.
* g++.dg/reflect/expr14.C: New test.
* g++.dg/reflect/expr2.C: New test.
* g++.dg/reflect/expr3.C: New test.
* g++.dg/reflect/expr4.C: New test.
* g++.dg/reflect/expr5.C: New test.
* g++.dg/reflect/expr6.C: New test.
* g++.dg/reflect/expr7.C: New test.
* g++.dg/reflect/expr8.C: New test.
* g++.dg/reflect/expr9.C: New test.
* g++.dg/reflect/extract1.C: New test.
* g++.dg/reflect/extract2.C: New test.
* g++.dg/reflect/extract3.C: New test.
* g++.dg/reflect/extract4.C: New test.
* g++.dg/reflect/extract5.C: New test.
* g++.dg/reflect/extract6.C: New test.
* g++.dg/reflect/extract7.C: New test.
* g++.dg/reflect/extract8.C: New test.
* g++.dg/reflect/extract9.C: New test.
* g++.dg/reflect/feat1.C: New test.
* g++.dg/reflect/feat2.C: New test.
* g++.dg/reflect/has_c_language_linkage1.C: New test.
* g++.dg/reflect/has_default_argument1.C: New test.
* g++.dg/reflect/has_default_argument2.C: New test.
* g++.dg/reflect/has_default_member_initializer1.C: New test.
* g++.dg/reflect/has_ellipsis_parameter1.C: New test.
* g++.dg/reflect/has_external_linkage1.C: New test.
* g++.dg/reflect/has_external_linkage2.C: New test.
* g++.dg/reflect/has_identifier1.C: New test.
* g++.dg/reflect/has_identifier2.C: New test.
* g++.dg/reflect/has_internal_linkage1.C: New test.
* g++.dg/reflect/has_internal_linkage2.C: New test.
* g++.dg/reflect/has_linkage1.C: New test.
* g++.dg/reflect/has_module_linkage1.C: New test.
* g++.dg/reflect/has_module_linkage2.C: New test.
* g++.dg/reflect/has_parent1.C: New test.
* g++.dg/reflect/has_template_arguments1.C: New test.
* g++.dg/reflect/has_template_arguments2.C: New test.
* g++.dg/reflect/has_template_arguments3.C: New test.
* g++.dg/reflect/has_template_arguments4.C: New test.
* g++.dg/reflect/identifier_of1.C: New test.
* g++.dg/reflect/identifier_of2.C: New test.
* g++.dg/reflect/init1.C: New test.
* g++.dg/reflect/init10.C: New test.
* g++.dg/reflect/init11.C: New test.
* g++.dg/reflect/init12.C: New test.
* g++.dg/reflect/init13.C: New test.
* g++.dg/reflect/init14.C: New test.
* g++.dg/reflect/init15.C: New test.
* g++.dg/reflect/init16.C: New test.
* g++.dg/reflect/init17.C: New test.
* g++.dg/reflect/init2.C: New test.
* g++.dg/reflect/init3.C: New test.
* g++.dg/reflect/init4.C: New test.
* g++.dg/reflect/init5.C: New test.
* g++.dg/reflect/init6.C: New test.
* g++.dg/reflect/init7.C: New test.
* g++.dg/reflect/init8.C: New test.
* g++.dg/reflect/init9.C: New test.
* g++.dg/reflect/is_accessible1.C: New test.
* g++.dg/reflect/is_accessible2.C: New test.
* g++.dg/reflect/is_alias_template1.C: New test.
* g++.dg/reflect/is_assignment1.C: New test.
* g++.dg/reflect/is_bit_field1.C: New test.
* g++.dg/reflect/is_class_member1.C: New test.
* g++.dg/reflect/is_class_template1.C: New test.
* g++.dg/reflect/is_complete_type1.C: New test.
* g++.dg/reflect/is_complete_type2.C: New test.
* g++.dg/reflect/is_concept1.C: New test.
* g++.dg/reflect/is_const1.C: New test.
* g++.dg/reflect/is_consteval_only1.C: New test.
* g++.dg/reflect/is_constructible_type1.C: New test.
* g++.dg/reflect/is_constructible_type2.C: New test.
* g++.dg/reflect/is_constructor_template1.C: New test.
* g++.dg/reflect/is_constuctor1.C: New test.
* g++.dg/reflect/is_conversion_function1.C: New test.
* g++.dg/reflect/is_conversion_function_template1.C: New test.
* g++.dg/reflect/is_copy_assignment1.C: New test.
* g++.dg/reflect/is_copy_constructor1.C: New test.
* g++.dg/reflect/is_data_member_spec1.C: New test.
* g++.dg/reflect/is_default_constructor1.C: New test.
* g++.dg/reflect/is_defaulted1.C: New test.
* g++.dg/reflect/is_defaulted2.C: New test.
* g++.dg/reflect/is_deleted1.C: New test.
* g++.dg/reflect/is_deleted2.C: New test.
* g++.dg/reflect/is_destructor1.C: New test.
* g++.dg/reflect/is_enumerable_type1.C: New test.
* g++.dg/reflect/is_enumerator1.C: New test.
* g++.dg/reflect/is_explicit1.C: New test.
* g++.dg/reflect/is_explicit2.C: New test.
* g++.dg/reflect/is_explicit_object_parameter1.C: New test.
* g++.dg/reflect/is_final1.C: New test.
* g++.dg/reflect/is_function1.C: New test.
* g++.dg/reflect/is_function2.C: New test.
* g++.dg/reflect/is_function3.C: New test.
* g++.dg/reflect/is_function_parameter1.C: New test.
* g++.dg/reflect/is_function_parameter2.C: New test.
* g++.dg/reflect/is_function_template1.C: New test.
* g++.dg/reflect/is_function_template2.C: New test.
* g++.dg/reflect/is_function_type1.C: New test.
* g++.dg/reflect/is_literal_operator1.C: New test.
* g++.dg/reflect/is_literal_operator_template1.C: New test.
* g++.dg/reflect/is_lrvalue_reference_qualified1.C: New test.
* g++.dg/reflect/is_move_assignment1.C: New test.
* g++.dg/reflect/is_move_constructor1.C: New test.
* g++.dg/reflect/is_mutable_member1.C: New test.
* g++.dg/reflect/is_namespace1.C: New test.
* g++.dg/reflect/is_namespace_alias1.C: New test.
* g++.dg/reflect/is_namespace_member1.C: New test.
* g++.dg/reflect/is_noexcept1.C: New test.
* g++.dg/reflect/is_noexcept2.C: New test.
* g++.dg/reflect/is_noexcept3.C: New test.
* g++.dg/reflect/is_noexcept4.C: New test.
* g++.dg/reflect/is_nonstatic_data_member1.C: New test.
* g++.dg/reflect/is_object1.C: New test.
* g++.dg/reflect/is_object2.C: New test.
* g++.dg/reflect/is_operator_function1.C: New test.
* g++.dg/reflect/is_operator_function_template1.C: New test.
* g++.dg/reflect/is_override1.C: New test.
* g++.dg/reflect/is_pure_virtual1.C: New test.
* g++.dg/reflect/is_special_member_function1.C: New test.
* g++.dg/reflect/is_static_member1.C: New test.
* g++.dg/reflect/is_string_literal1.C: New test.
* g++.dg/reflect/is_structured_binding1.C: New test.
* g++.dg/reflect/is_structured_binding2.C: New test.
* g++.dg/reflect/is_template1.C: New test.
* g++.dg/reflect/is_template2.C: New test.
* g++.dg/reflect/is_type1.C: New test.
* g++.dg/reflect/is_type_alias1.C: New test.
* g++.dg/reflect/is_type_alias2.C: New test.
* g++.dg/reflect/is_type_alias3.C: New test.
* g++.dg/reflect/is_user_declared1.C: New test.
* g++.dg/reflect/is_user_declared2.C: New test.
* g++.dg/reflect/is_user_provided1.C: New test.
* g++.dg/reflect/is_user_provided2.C: New test.
* g++.dg/reflect/is_variable1.C: New test.
* g++.dg/reflect/is_variable_template1.C: New test.
* g++.dg/reflect/is_virtual1.C: New test.
* g++.dg/reflect/is_volatile1.C: New test.
* g++.dg/reflect/lex1.C: New test.
* g++.dg/reflect/lex2.C: New test.
* g++.dg/reflect/mangle1.C: New test.
* g++.dg/reflect/member-visibility1.C: New test.
* g++.dg/reflect/member-visibility2.C: New test.
* g++.dg/reflect/member1.C: New test.
* g++.dg/reflect/member10.C: New test.
* g++.dg/reflect/member11.C: New test.
* g++.dg/reflect/member12.C: New test.
* g++.dg/reflect/member13.C: New test.
* g++.dg/reflect/member14.C: New test.
* g++.dg/reflect/member15.C: New test.
* g++.dg/reflect/member16.C: New test.
* g++.dg/reflect/member17.C: New test.
* g++.dg/reflect/member18.C: New test.
* g++.dg/reflect/member19.C: New test.
* g++.dg/reflect/member2.C: New test.
* g++.dg/reflect/member20.C: New test.
* g++.dg/reflect/member3.C: New test.
* g++.dg/reflect/member4.C: New test.
* g++.dg/reflect/member5.C: New test.
* g++.dg/reflect/member6.C: New test.
* g++.dg/reflect/member7.C: New test.
* g++.dg/reflect/member8.C: New test.
* g++.dg/reflect/member9.C: New test.
* g++.dg/reflect/members_of1.C: New test.
* g++.dg/reflect/members_of2.C: New test.
* g++.dg/reflect/members_of3.C: New test.
* g++.dg/reflect/members_of4.C: New test.
* g++.dg/reflect/members_of5.C: New test.
* g++.dg/reflect/members_of6.C: New test.
* g++.dg/reflect/members_of7.C: New test.
* g++.dg/reflect/metafn-ptr1.C: New test.
* g++.dg/reflect/ns1.C: New test.
* g++.dg/reflect/ns2.C: New test.
* g++.dg/reflect/ns3.C: New test.
* g++.dg/reflect/ns4.C: New test.
* g++.dg/reflect/ns5.C: New test.
* g++.dg/reflect/ns6.C: New test.
* g++.dg/reflect/null1.C: New test.
* g++.dg/reflect/null2.C: New test.
* g++.dg/reflect/null3.C: New test.
* g++.dg/reflect/null4.C: New test.
* g++.dg/reflect/null5.C: New test.
* g++.dg/reflect/object_of1.C: New test.
* g++.dg/reflect/object_of2.C: New test.
* g++.dg/reflect/odr1.C: New test.
* g++.dg/reflect/offset_of1.C: New test.
* g++.dg/reflect/operator_of1.C: New test.
* g++.dg/reflect/override1.C: New test.
* g++.dg/reflect/p2996-1.C: New test.
* g++.dg/reflect/p2996-10.C: New test.
* g++.dg/reflect/p2996-11.C: New test.
* g++.dg/reflect/p2996-12.C: New test.
* g++.dg/reflect/p2996-13.C: New test.
* g++.dg/reflect/p2996-14.C: New test.
* g++.dg/reflect/p2996-15.C: New test.
* g++.dg/reflect/p2996-16.C: New test.
* g++.dg/reflect/p2996-17.C: New test.
* g++.dg/reflect/p2996-18.C: New test.
* g++.dg/reflect/p2996-19.C: New test.
* g++.dg/reflect/p2996-2.C: New test.
* g++.dg/reflect/p2996-20.C: New test.
* g++.dg/reflect/p2996-21.C: New test.
* g++.dg/reflect/p2996-3.C: New test.
* g++.dg/reflect/p2996-4.C: New test.
* g++.dg/reflect/p2996-5.C: New test.
* g++.dg/reflect/p2996-6.C: New test.
* g++.dg/reflect/p2996-7.C: New test.
* g++.dg/reflect/p2996-8.C: New test.
* g++.dg/reflect/p2996-9.C: New test.
* g++.dg/reflect/p3394-1.C: New test.
* g++.dg/reflect/p3491-1.C: New test.
* g++.dg/reflect/p3491-2.C: New test.
* g++.dg/reflect/p3491-3.C: New test.
* g++.dg/reflect/pack-index1.C: New test.
* g++.dg/reflect/parameters_of1.C: New test.
* g++.dg/reflect/parameters_of2.C: New test.
* g++.dg/reflect/parameters_of3.C: New test.
* g++.dg/reflect/parameters_of4.C: New test.
* g++.dg/reflect/parameters_of5.C: New test.
* g++.dg/reflect/parameters_of6.C: New test.
* g++.dg/reflect/parent_of1.C: New test.
* g++.dg/reflect/parm1.C: New test.
* g++.dg/reflect/parm2.C: New test.
* g++.dg/reflect/parm3.C: New test.
* g++.dg/reflect/parm4.C: New test.
* g++.dg/reflect/pr122634-1.C: New test.
* g++.dg/reflect/pr122634-2.C: New test.
* g++.dg/reflect/qrn1.C: New test.
* g++.dg/reflect/qrn2.C: New test.
* g++.dg/reflect/range_args.C: New test.
* g++.dg/reflect/reflect_constant1.C: New test.
* g++.dg/reflect/reflect_constant2.C: New test.
* g++.dg/reflect/reflect_constant3.C: New test.
* g++.dg/reflect/reflect_constant4.C: New test.
* g++.dg/reflect/reflect_constant5.C: New test.
* g++.dg/reflect/reflect_constant6.C: New test.
* g++.dg/reflect/reflect_constant7.C: New test.
* g++.dg/reflect/reflect_constant8.C: New test.
* g++.dg/reflect/reflect_constant9.C: New test.
* g++.dg/reflect/reflect_constant_array1.C: New test.
* g++.dg/reflect/reflect_constant_array2.C: New test.
* g++.dg/reflect/reflect_constant_array3.C: New test.
* g++.dg/reflect/reflect_constant_array4.C: New test.
* g++.dg/reflect/reflect_constant_string1.C: New test.
* g++.dg/reflect/reflect_constant_string2.C: New test.
* g++.dg/reflect/reflect_function1.C: New test.
* g++.dg/reflect/reflect_function2.C: New test.
* g++.dg/reflect/reflect_object1.C: New test.
* g++.dg/reflect/reflect_object2.C: New test.
* g++.dg/reflect/reflect_object3.C: New test.
* g++.dg/reflect/reflect_object4.C: New test.
* g++.dg/reflect/return_type_of1.C: New test.
* g++.dg/reflect/return_type_of2.C: New test.
* g++.dg/reflect/serialize1.C: New test.
* g++.dg/reflect/serialize2.C: New test.
* g++.dg/reflect/size_of1.C: New test.
* g++.dg/reflect/source_location_of1.C: New test.
* g++.dg/reflect/source_location_of2.C: New test.
* g++.dg/reflect/splice1.C: New test.
* g++.dg/reflect/splice2.C: New test.
* g++.dg/reflect/splice3.C: New test.
* g++.dg/reflect/splice4.C: New test.
* g++.dg/reflect/splice5.C: New test.
* g++.dg/reflect/splice6.C: New test.
* g++.dg/reflect/splice7.C: New test.
* g++.dg/reflect/splicing-base1.C: New test.
* g++.dg/reflect/splicing-base2.C: New test.
* g++.dg/reflect/splicing-base3.C: New test.
* g++.dg/reflect/splicing-base4.C: New test.
* g++.dg/reflect/storage_duration1.C: New test.
* g++.dg/reflect/storage_duration2.C: New test.
* g++.dg/reflect/storage_duration3.C: New test.
* g++.dg/reflect/subobjects_of1.C: New test.
* g++.dg/reflect/substitute1.C: New test.
* g++.dg/reflect/substitute2.C: New test.
* g++.dg/reflect/symbol_of1.C: New test.
* g++.dg/reflect/symbol_of2.C: New test.
* g++.dg/reflect/template_arguments_of1.C: New test.
* g++.dg/reflect/template_arguments_of2.C: New test.
* g++.dg/reflect/template_arguments_of3.C: New test.
* g++.dg/reflect/template_of1.C: New test.
* g++.dg/reflect/template_of2.C: New test.
* g++.dg/reflect/template_of3.C: New test.
* g++.dg/reflect/tuple1.C: New test.
* g++.dg/reflect/tuple2.C: New test.
* g++.dg/reflect/type1.C: New test.
* g++.dg/reflect/type10.C: New test.
* g++.dg/reflect/type2.C: New test.
* g++.dg/reflect/type3.C: New test.
* g++.dg/reflect/type4.C: New test.
* g++.dg/reflect/type5.C: New test.
* g++.dg/reflect/type6.C: New test.
* g++.dg/reflect/type7.C: New test.
* g++.dg/reflect/type8.C: New test.
* g++.dg/reflect/type9.C: New test.
* g++.dg/reflect/type_of1.C: New test.
* g++.dg/reflect/type_of2.C: New test.
* g++.dg/reflect/type_rels1.C: New test.
* g++.dg/reflect/type_trait1.C: New test.
* g++.dg/reflect/type_trait10.C: New test.
* g++.dg/reflect/type_trait11.C: New test.
* g++.dg/reflect/type_trait12.C: New test.
* g++.dg/reflect/type_trait13.C: New test.
* g++.dg/reflect/type_trait2.C: New test.
* g++.dg/reflect/type_trait3.C: New test.
* g++.dg/reflect/type_trait4.C: New test.
* g++.dg/reflect/type_trait5.C: New test.
* g++.dg/reflect/type_trait6.C: New test.
* g++.dg/reflect/type_trait8.C: New test.
* g++.dg/reflect/type_trait9.C: New test.
* g++.dg/reflect/u8display_string_of1.C: New test.
* g++.dg/reflect/u8identifier_of1.C: New test.
* g++.dg/reflect/u8symbol_of1.C: New test.
* g++.dg/reflect/underlying_type1.C: New test.
* g++.dg/reflect/using1.C: New test.
* g++.dg/reflect/value_or_object1.C: New test.
* g++.dg/reflect/variable_of1.C: New test.
* g++.dg/reflect/variable_of2.C: New test.
* g++.dg/reflect/variable_of3.C: New test.
* g++.dg/reflect/variant1.C: New test.
* g++.dg/reflect/variant2.C: New test.
* g++.dg/reflect/vector1.C: New test.
* g++.dg/reflect/visibility1.C: New test.
Co-authored-by: Jakub Jelinek <jakub@redhat.com> Signed-off-by: Valentyn Yukhymenko <vyuhimenko@bloomberg.net> Signed-off-by: Alex Yesmanchyk <ayesmanchyk@bloomberg.net> Signed-off-by: Michael Levine <mlevine55@bloomberg.net> Reviewed-by: Jason Merrill <jason@redhat.com>
Peter Damianov [Sat, 10 Jan 2026 09:19:54 +0000 (09:19 +0000)]
Remove .res specs to fix COFF passthrough [PR123504]
Some packages (gnulib) pass COFF object files with .res extension
directly to gcc, expecting them to be passed through to the linker,
instead of windres. However, the current EXTRA_DEFAULT_COMPILERS spec
intercepts all .res files and runs them through windres, which fails for
COFF files that are not Windows resource files (Microsoft Visual C
binary resource file as identified by libmagic/file).
This patch removes the .res file specs, leaving only the .rc
support specs active. At a later date, this can be reviewed.
The driver could inspect the .res file to see if it's a object file or,
but, it's somewhat questionable if handling .res is even useful.
gcc/ChangeLog:
PR driver/123504
* config/i386/cygming.h (EXTRA_DEFAULT_COMPILERS): Comment out
.res spec to allow COFF files with .res extension to pass
through to the linker.
* config/aarch64/cygming.h (EXTRA_DEFAULT_COMPILERS): Likewise.
In ira_implicitly_set_insn_hard_regs() all potentially used registers
stemming from single register constraints are recorded. Since hard
register constraints are pretty similar, do the same for those, too.
This requires to setup the preferred alternatives which is done via
ira_setup_alts() and also implemented for hard register constraints by
this patch.
This fixes an ICE were previously sched1 swapped the order of the
instructions
Deal with combinations of hard register constraints
Currently, multiple hard register constraints in one alternative are not
supported. Likewise, a combination of hard register constraints and
regular register constraints is not supported. Note, a combination of
hard register constraints and non-register constraints as e.g. immediate
constraints is supported. This is inspired by the i386 target where
constraints like aI are used which could be expressed as {ax}I, too.
gcc/ChangeLog:
* doc/extend.texi: Document current limitations of hard register
constraints.
* stmt.cc (parse_output_constraint): Reject multiple hard
register constraints or a combination of hard register
constraints and regular register constraints in one alternative.
(parse_input_constraint): Ditto.
gcc/testsuite/ChangeLog:
* gcc.dg/asm-hard-reg-error-1.c: Remove tests containing
multiple hard register constraints in one alternative.
* gcc.dg/asm-hard-reg-error-6.c: New test.
Jakub Jelinek [Thu, 15 Jan 2026 11:03:34 +0000 (12:03 +0100)]
compare-debug: Don't print discriminators for -fdump-final-insns= [PR121045]
Given the discussions in the PR, seems it is intentional that debug
stmts are taken into account when assigning discriminators which is
something that is actually never emitted into generated code, only
into debug info, so for -g0 we might as well not try to compute them
at all.
But discriminators are printed in the dumps, including -fdump-final-insns=
dump which affect -fcompare-debug.
So, the following patch arranges not to print discriminators in that
dump (i.e. when TDF_COMPARE_DEBUG is set in flags).
I think we should also (but it can be handled incrementally) add
some new TDF_* flag and -fdump-{tree,rtl,ipa}-<pass> modifier which
will also disable printing discriminators (similar to nouid/TDF_NOUID)
so that people can use it e.g. in -fcompare-debug -fdump-tree-all-nodiscrim
and don't have to ignore discrim N changes in the dumps.
This patch fixes
-FAIL: c-c++-common/torture/pr116156-1.c -O1 (test for excess errors)
-FAIL: c-c++-common/torture/pr116156-1.c -O2 (test for excess errors)
-FAIL: c-c++-common/torture/pr116156-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors)
-FAIL: c-c++-common/torture/pr116156-1.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors)
-FAIL: c-c++-common/torture/pr116156-1.c -O3 -g (test for excess errors)
-FAIL: c-c++-common/torture/pr116156-1.c -Os (test for excess errors)
-FAIL: g++.dg/torture/pr58552.C -O1 (test for excess errors)
-FAIL: g++.dg/torture/pr58552.C -O2 (test for excess errors)
-FAIL: g++.dg/torture/pr58552.C -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors)
-FAIL: g++.dg/torture/pr58552.C -O3 -g (test for excess errors)
-FAIL: g++.dg/torture/pr58552.C -Os (test for excess errors)
so no testcase added for it.
2026-01-15 Jakub Jelinek <jakub@redhat.com>
PR debug/121045
* tree-pretty-print.h (dump_location): Add new dump_flags_t
argument defaulted to TDF_NONE.
* tree-pretty-print.cc (dump_location): Add flags argument. Don't
print discriminator if TDF_COMPARE_DEBUG bit is set in flags.
(dump_block_node, dump_generic_node): Pass through flags to
dump_location.
* gimple-pretty-print.cc (dump_gimple_phi, pp_gimple_stmt_1,
dump_implicit_edges): Likewise.
(gimple_dump_bb_as_sarif_properties): Pass dump_flags to
dump_location.
* print-rtl.cc (rtx_writer::print_rtx_operand_code_L): If dump_flags
has TDF_COMPARE_DEBUG bit set, don't print discriminators.
Rainer Orth [Thu, 15 Jan 2026 10:13:49 +0000 (11:13 +0100)]
Use -m32/-m64 with Solaris/x86 as
GCC currently uses -xarch=generic/-xarch=generic64 with Solaris/x86 as
to select either 32 or 64-bit output. However, -xarch isn't even
documented any longer, but still accepted for compatibility. Even for
-xchip, only generic is documented, not generic64.
This patch uses -m32/-m64 instead, which is already used in
gcc/configure.ac.
Bootstrapped without regressions on i386-pc-solaris2.11 and
amd64-pc-solaris2.11.
Hi,
previously, callback edges of a carrying edge redirected to
__builtin_unreachable were deleted, as I thought they would
mess with the callgraph, given that they were no longer correct.
In some cases, the edges would be deleted when duplicating
a fn summary, producing a segfault. This patch changes this
behavior. It redirects the callback edges to __builtin_unreachable and
adds an exception for such cases in the verifier. Callback edges are
now also required to point to __builtin_unreachable if their carrying
edge is pointing to __builtin_unreachable.
Bootstrapped and regtested on x86_64-linux, no regressions.
OK for master?
Thanks,
Josef
PR ipa/122852
gcc/ChangeLog:
* cgraph.cc (cgraph_node::verify_node): Verify that callback
edges are unreachable when the carrying edge is unreachable.
* ipa-fnsummary.cc (redirect_to_unreachable): Redirect callback
edges to unreachable when redirecting the carrying edge.
Rainer Orth [Thu, 15 Jan 2026 08:50:04 +0000 (09:50 +0100)]
sparc: Remove HAVE_AS_SPARC_UA_PCREL and HAVE_AS_SPARC_UA_PCREL_HIDDEN
The SPARC backend currently has workarounds for two bugs in old versions
of the assembler and linker. However, I find both
HAVE_AS_SPARC_UA_PCREL and HAVE_AS_SPARC_UA_PCREL_HIDDEN are always
defined as 1 on both Solaris/SPARC and Linux/sparc64.
I've checked all combinations of the assemblers supported on SPARC: the
Solaris 11.4 FCS as and ld, current Solaris as and ld, gas and gld 2.30
and 2.45. The tests work on all of those, so the workarounds can be
removed.
Bootstrapped on sparc-sun-solaris2.11 (as and gas) and
sparc64-unknown-linux-gnu.
Rainer Orth [Thu, 15 Jan 2026 08:45:06 +0000 (09:45 +0100)]
sparc: Switch TARGET_SUN_TLS default
sparc/sparc.h currently defaults to TARGET_SUN_TLS. All other SPARC
targets and Solaris with GNU as have to override this, although this is
only needed on Solaris/SPARC with the native assembler.
To simplify the code, this patch switches the default to TARGET_SUN_TLS
set to 0, removing the need for all the overrides.
TARGET_GNU_TLS is only used in two places and can be replaced by
!TARGET_SUN_TLS, too.
Bootstrapped without regressions on sparc-sun-solaris2.11 (as and gas)
and sparc64-unknown-linux-gnu.
sparc/sol2.h has its own definition of ASM_OUTPUT_ALIGNED_COMMON,
overriding the elfos.h version. This was introduced back in 2010 as a
workaround for a bug in old versions of the Solaris/SPARC assembler (PR
target/38118). However, even the Solaris 11.4 FCS as, the oldest one
currently supported, doesn't have this bug any longer. Besides, the
workaround hasn't been effective anymore since GCC 10 without ill
effect.
Therefore the override definition can simply be removed.
Bootstrapped without regression on sparc-sun-solaris2.11 (as and gas).
This patch introduces the basic infrastructure for hierarchical
discriminators with format [Base:8][Multiplicity:7][CopyID:11][Unused:6].
It adds helper functions to create and extract discriminator components.
gcc/ChangeLog:
* Makefile.in: Add hierarchical_discriminator.o to OBJS.
* hierarchical_discriminator.cc: New file.
* hierarchical_discriminator.h: New file.
* function.h (copyid_alloc): New.
* input.cc (location_with_discriminator_components): New function.
(get_discriminator_components_from_loc): Likewise.
* input.h (DISCR_BASE_BITS): New constant.
(DISCR_MULTIPLICITY_BITS): Likewise.
(DISCR_COPYID_BITS): Likewise.
(DISCR_UNUSED_BITS): Likewise.
(DISCR_BASE_MASK): Likewise.
(DISCR_MULTIPLICITY_MASK): Likewise.
(DISCR_COPYID_MASK): Likewise.
(DISCR_BASE_SHIFT): Likewise.
(DISCR_MULTIPLICITY_SHIFT): Likewise.
(DISCR_COPYID_SHIFT): Likewise.
(DISCR_BASE_MAX): Likewise.
(DISCR_MULTIPLICITY_MAX): Likewise.
(DISCR_COPYID_MAX): Likewise.
(location_with_discriminator_components): New function declaration.
(get_discriminator_components_from_loc): Likewise.
DengJianbo [Tue, 13 Jan 2026 07:21:54 +0000 (15:21 +0800)]
LoongArch: Fix ICE when explicit-relocs is none
When set -mexplicit-relocs=none, the symbol address should be caclulated
by macro instructions, for example la.local. Due to the condition
TARGET_CMODEL_EXTREME in movdi_symbolic_off64, this template can not be
matched in case the cmodel is normal. If the variable has attribute
model("extreme"), gcc will get crashed with error unrecognizable insns.
This patch fix this issue by removing TARGET_CMODEL_EXTREME, since it
already checked in prediction symbolic_off64_or_reg_operand.
gcc/ChangeLog:
* config/loongarch/loongarch.md: Remove condition in template
movdi_symbolic_off64.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/la64/attr-model-6.c: New test.