]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
8 days agolibstdc++: Simplify std::regex_traits::value
Jonathan Wakely [Tue, 28 Oct 2025 12:15:52 +0000 (12:15 +0000)] 
libstdc++: Simplify std::regex_traits::value

We don't need to use an istringstream to convert a hex digit to its
numerical value. And if we don't use istringstream there, we don't need
to include <sstream> in <regex>.

libstdc++-v3/ChangeLog:

* include/bits/regex.tcc (regex_traits::value): Implement
without using istringstream.
* include/std/regex: Do not include <sstream>.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
9 days agoHandle VIEW_CONVERT_EXPR for non-floats.
Andrew MacLeod [Sat, 25 Oct 2025 15:59:55 +0000 (11:59 -0400)] 
Handle VIEW_CONVERT_EXPR for non-floats.

Handle VIEW_CONVERT_EXPR for ranges as if it were a cast.

PR tree-optimization/91191
gcc/
* gimple-range-op.cc (gimple_range_op_handler): Descend one
operand lower for a VIEW_CONVERT_EXPR.
* range-op-mixed.h (class operator_view): New.
* range-op.cc (range_op_table): Add VIEW_CONVERT_EXPR case.
(operator_view::fold_range): New.
(operator_view::op1_range): New.
(operator_view::update_bitmask): New.

gcc/testsuite/
* gcc.dg/pr91191.c: New.

9 days agoFix possible double-free and leak in BB SLP discovery
Richard Biener [Wed, 29 Oct 2025 08:03:57 +0000 (09:03 +0100)] 
Fix possible double-free and leak in BB SLP discovery

vect_build_slp_instance always releases the scalar stmts vector, so make sure
to mark it as released and actually release it.

* tree-vect-slp.cc (vect_analyze_slp): Mark stmts in BB roots
as released after vect_build_slp_instance.
(vect_build_slp_instance): Release scalar_stmts when exiting
early.

9 days agoFortran: PDT - gfortran does not catch F2023:R916 [PR122165]
Paul Thomas [Wed, 29 Oct 2025 11:06:19 +0000 (11:06 +0000)] 
Fortran:  PDT - gfortran does not catch F2023:R916 [PR122165]

2025-10-29  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122165
* primary.cc (gfc_match_varspec): If the previous component ref
was a type specification parameter, a type inquiry ref cannot
follow.

gcc/testsuite
PR fortran/122165
* gfortran.dg/pdt_64.f03: New test.

9 days agoTestcase for PR70102
Richard Biener [Wed, 29 Oct 2025 10:49:06 +0000 (11:49 +0100)] 
Testcase for PR70102

We are now able to vectorize the PR70102 testcase using a SLP reduction chain.

PR tree-optimization/70102
* gfortran.dg/vect/pr70102.f: New testcase.

9 days agoFortran: Fix recursive PDT function invocation [PR122433, PR122434]
Paul Thomas [Wed, 29 Oct 2025 09:20:24 +0000 (09:20 +0000)] 
Fortran: Fix recursive PDT function invocation [PR122433, PR122434]

2025-10-29  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122433
* decl.cc (gfc_get_pdt_instance): Prevent a PDT component of
the same type as the template from being converted into an
instance.

PR fortran/122434
* resolve.cc (gfc_impure_variable): The result of a pure
function is a valid allocate object since it is pure.

gcc/testsuite/
PR fortran/122433
* gfortran.dg/pdt_62.f03: New test.

PR fortran/122434
* gfortran.dg/pdt_63.f03: New test.

9 days agoLoongArch: Fix bug for PR122097.
Lulu Cheng [Tue, 30 Sep 2025 03:32:47 +0000 (11:32 +0800)] 
LoongArch: Fix bug for PR122097.

When implementing the vector template for copysign, we used vector
floating-point AND and IOR operations. This allows AND and IOR operands
to be vector floating-point types. However, the constraint YC does not
handle vector floating-point constants, resulting in ICE.

PR target/122097

gcc/ChangeLog:

* config/loongarch/loongarch.cc
(loongarch_const_vector_bitimm_set_p): Add support for vector float.
(loongarch_const_vector_bitimm_clr_p): Likewise.
(loongarch_print_operand): Likewise.
* config/loongarch/simd.md (and<mode>3): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/pr122097.c: New test.

9 days agoLoongArch: Move vector templates of and xor ior to simd.md.
Lulu Cheng [Thu, 16 Oct 2025 07:45:09 +0000 (15:45 +0800)] 
LoongArch: Move vector templates of and xor ior to simd.md.

gcc/ChangeLog:

* config/loongarch/lasx.md (xor<mode>3): Delete.
(ior<mode>3): Delete.
(and<mode>3): Delete.
* config/loongarch/lsx.md (xor<mode>3): Delete.
(ior<mode>3): Delete.
(and<mode>3): Delete.
* config/loongarch/simd.md (xor<mode>3): Define.
(ior<mode>3): Likewise.
(and<mode>3): Likewise.

9 days agoLoongArch: Make the code generation of the trap pattern configurable
Xi Ruoyao [Sun, 26 Oct 2025 05:20:20 +0000 (13:20 +0800)] 
LoongArch: Make the code generation of the trap pattern configurable

In some applications (notably the Linux kernel), "break 0" is used as a
trap that a handler may be able to recover.  But in GCC the "trap"
pattern is meant to make the program rightfully die instead.

As [1] describes, sometimes it's vital to distinguish between the two
cases.  The kernel developers prefer "break 1" here, but in the
user-space it's better to trigger a SIGILL instead of SIGTRAP as the
latter is more likely used as a application-defined trap.

To support both cases, make the code generation configurable with a new
option.

[1]:https://lore.kernel.org/20250923061722.24457-1-yangtiezhu@loongson.cn

gcc/

* config/loongarch/genopts/loongarch.opt.in (-mbreak-code=):
New.
* config/loongarch/loongarch.opt: Regenerate.
* config/loongarch/loongarch.md (trap): Separate to a
define_insn and a define_expand which takes la_break_code.
* doc/invoke.texi (-mbreak-code=): Document.
* config/loongarch/loongarch.opt.urls: Regenerate.

gcc/testsuite

* gcc.target/loongarch/trap-default.c: New test.
* gcc.target/loongarch/trap-1.c: New test.

9 days agoDaily bump.
GCC Administrator [Wed, 29 Oct 2025 00:19:49 +0000 (00:19 +0000)] 
Daily bump.

9 days agoAda: Fix visibility issue for child unit declared as instance on homonym
Eric Botcazou [Tue, 28 Oct 2025 22:04:49 +0000 (23:04 +0100)] 
Ada: Fix visibility issue for child unit declared as instance on homonym

The reproducer is made up of 9 units containing multiple level of nested
instances, but in the end the problem is that the final child unit has
the same name as the parameter in its instantiation, exposing the wrong
manipulation of the homonym chain done in Analyze_Subprogram_Instantiation.

The fix is to replace this manipulation with a call to Remove_Homonym.

gcc/ada/
PR ada/48039
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Call
Remove_Homonym to remove the enclosing package from visibility.

9 days agoc++: share more trees representing enumerators
Marek Polacek [Tue, 28 Oct 2025 00:08:00 +0000 (20:08 -0400)] 
c++: share more trees representing enumerators

This came up in Reflection where an assert fails because we have two
different trees for same enumerators.  The reason is that in
finish_enum_value_list we copy_node when converting the enumerators.
It should be more efficient to share trees for identical enumerators.
This fix was proposed by Jakub.

gcc/cp/ChangeLog:

* decl.cc (finish_enum_value_list): Use fold_convert instead of
copy_node.

Co-authored-by: Jakub Jelinek <jakub@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
9 days agolibstdc++: Fix deadlock in shared_timed_mutex test [PR122401]
Jonathan Wakely [Fri, 24 Oct 2025 10:38:22 +0000 (11:38 +0100)] 
libstdc++: Fix deadlock in shared_timed_mutex test [PR122401]

The test_shared_relative function deadlocks on older Glibc versions that
don't have pthread_rwlock_clockrdlock, because (as already mentioned
earlier in the test file) pthread_rwlock_timedrdlock returns EDEADLK if
the thread that already holds a write lock attempts to acquire read
lock, causing std::shared_timed_mutex to loop forever.

The fix is to do the invalid try_lock_shared_for call on a different
thread. To avoid undefined behaviour, we need to make the same changes
to all calls that try to acquire a lock that is already held.

Also add missing -pthread for PR122401.

libstdc++-v3/ChangeLog:

PR libstdc++/122401
* testsuite/30_threads/shared_timed_mutex/try_lock_until/116586.cc:
Do not try to acquire locks on the thread that already holds a
lock. Add -pthread for et pthread.

Reviewed-by: Mike Crowe <mac@mcrowe.com>
Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
10 days agoeditorconfig: Add explicit tab_width when indent_size != 8
Richard Earnshaw [Tue, 28 Oct 2025 15:06:51 +0000 (15:06 +0000)] 
editorconfig: Add explicit tab_width when indent_size != 8

The documentation for editorconfig files says that setting indent_size
changes the default value of tab_width; but the documentation is a
little ambiguous as to what happens if the two values are set via
different match rules.  I'd generally expect in this case that the
defaulting behavior would only kick in if there were no setting of
tab_width at all, but it seems that the go implementation (or at least
the way forgejo uses the go implementation) does not do this.

However, it is fairly easy to make this all explicit by explicitly
setting tab_width whenever we have an indent_size that is not 8.  I've
deliberately omitted overriding this when the indent style is set to
space, since this should make the presence of a hard tab show up in
the forge UI more clearly as incorrect indentation.

/ChangeLog:
* .editorconfig: Explicitly set tab_width whenever a
config rule has indent_style = tab and indent_size != 8.

10 days agofortran: revise non-char pointer handling in gfc_conv_constant
Yuao Ma [Mon, 27 Oct 2025 17:58:39 +0000 (01:58 +0800)] 
fortran: revise non-char pointer handling in gfc_conv_constant

PR fortran/122342

gcc/fortran/ChangeLog:

* trans-const.cc (gfc_conv_constant): Create a variable for the
non-char pointer.

gcc/testsuite/ChangeLog:

* gfortran.dg/coarray_atomic_5.f90: Update testcase.
* gfortran.dg/team_form_3.f90: Likewise.

10 days agoTLC to vect_update_ivs_after_vectorizer
Richard Biener [Tue, 28 Oct 2025 12:17:35 +0000 (13:17 +0100)] 
TLC to vect_update_ivs_after_vectorizer

The following makes it work on the non-main exit.

* tree-vect-loop-manip.cc (vect_update_ivs_after_vectorizer):
Avoid explicit LOOP_VINFO_IV_EXIT reference.

10 days agoMAINTAINERS: add myself to write after approval
Artemiy Volkov [Tue, 28 Oct 2025 12:51:29 +0000 (12:51 +0000)] 
MAINTAINERS: add myself to write after approval

Add an entry for myself to the write after approval list.  Pushed as
obvious.

ChangeLog:

* MAINTAINERS: Add myself to write after approval.

10 days agoada: Fix miscompilation at -O2 due to aliasing issue caused by -gnatVa
Eric Botcazou [Wed, 1 Oct 2025 10:28:59 +0000 (12:28 +0200)] 
ada: Fix miscompilation at -O2 due to aliasing issue caused by -gnatVa

The problem is that the expanded code generated by -gnatVa (-gnatVc to be
precise) violates strict aliasing rules, because it contains a 'Reference
to an elementary component that is nonaliased ('Reference is equivalent to
a pointer for code generation purposes and the "aliased" keyword is trusted
for components whose type is elementary by code generators).

Remove_Side_Effects already knows that it must make a copy for elementary
types instead of taking 'Reference, but it is fooled by the private type
of the expression.  The fix is to still use the Etype to build new nodes,
but to use its Underlying_Type to select the strategy to do so.

gcc/ada/ChangeLog:

* exp_util.adb (Remove_Side_Effects): Use separately the Etype of
the expression to build new nodes and its Underlying_Type to drive
part of the processing.

10 days agoada: Rework disabling signals when calling pthread_create on QNX
Johannes Kliemann [Fri, 26 Sep 2025 16:16:07 +0000 (18:16 +0200)] 
ada: Rework disabling signals when calling pthread_create on QNX

Use the correct pthread_sigmask instead of sigprocmask when disabling
signals on QNX. Furthermore make use of the already existing bindings to
implement that functionality in Ada instead of C. Enable signals in both
Create_Task and Enter_Task as they need to be enabled in both the parent
and the child.

gcc/ada/ChangeLog:

* adaint.c: Remove __gnat_enable_signals, __gnat_disable_signals
and related code for QNX.
* libgnarl/s-taprop__qnx.adb: Disable and enable
signals in Ada.

10 days agoada: do not Set_Is_Imported on exception names
Alexandre Oliva [Mon, 22 Sep 2025 16:11:12 +0000 (13:11 -0300)] 
ada: do not Set_Is_Imported on exception names

Exception names don't get the Is_Imported flag set even when they're
imported from CPP.  With the flag set, we end up referencing an
external variable instead of defining the exception data structure as
expected, and aspect Import behaves differently from pragma Import.

Refrain from calling Set_Is_Imported when analyzing an exception's
Import aspect.

gcc/ada/ChangeLog:

* sem_ch13.adb (Analyze_Aspect_Export_Import): Skip
Set_Is_Imported on E_Exception.
* sem_prag.adb (Process_Import_Or_Interface): Explain
why not Set_Is_Imported.

10 days agoada: Fix incorrectly inherited non-primitive subprograms
Denis Mazzucato [Wed, 20 Aug 2025 09:42:11 +0000 (11:42 +0200)] 
ada: Fix incorrectly inherited non-primitive subprograms

This patch avoids marking subprograms not declared immediately within package
specifications as primitive, unless they're either inherited or overriding.

gcc/ada/ChangeLog:

* sem_util.adb (Collect_Primitive_Operations): Avoid setting
Is_Primitive for noninherited and nonoverriding subprograms not
declared immediately within a package specification.
* sem_ch13.adb (Check_Nonoverridable_Aspect_Subprograms): Better
error posting to allow multiple errors on same type but different
aggregate subprogram.

10 days agoada: Add new abstractions to Table.Table
Ronan Desplanques [Mon, 29 Sep 2025 08:26:34 +0000 (10:26 +0200)] 
ada: Add new abstractions to Table.Table

This patch adds two new subprograms to Table.Table: Clear and Is_Empty.
Their selling point is that they don't require being aware of the bounds
of the instance of Table.Table, avoiding the off-by-one errors that can
happen when using Set_Last or Last directly.

This patch also replaces existing code by calls to these new subprograms
in a few places where it makes sense. It also adds a call to
Table.Table.First in the same spirit on the side.

gcc/ada/ChangeLog:

* table.ads (Clear, Is_Empty): New subprograms.
* table.adb (Clear, Is_Empty): Likewise.
(Init): Use new subprogram.
* atree.adb (Traverse_Func_With_Parent): Use new subprograms.
* fmap.adb (Empty_Tables): Use new subprogram.
* par_sco.adb (Process_Pending_Decisions): Likewise.
* sem_elab.adb (Check_Elab_Call): Likewise.
* sem_ch12.adb (Build_Local_Package, Analyze_Package_Instantiation,
Analyze_Subprogram_Instantiation): Likewise.
(Save_And_Reset): Use Table.Table.First.

10 days agoada: Fix unexpected overflow check before fixed-point multiplication
Eric Botcazou [Fri, 26 Sep 2025 17:45:10 +0000 (19:45 +0200)] 
ada: Fix unexpected overflow check before fixed-point multiplication

The problem is that the code generating the fixed-point multiply uses the
subtypes of the operands to size the operation, while operations are to be
performed in base types, which are signed per the RM 3.5.9(12) subclause.
As a consequence, when the subtypes are fully asymmetric unsigned, the size
is too small and an incorrect overflow check is generated.

The code generating the divide was fixed a long time ago, this aligns the
code generating the multiply and the code generating the remainder, which
in turn requires a couple of adjustments to related routines.

gcc/ada/ChangeLog:

PR ada/122063
* exp_fixd.adb (Build_Double_Divide_Code): Convert the result of the
multiply.
(Build_Multiply): Use base types of operands to size the operation.
(Build_Rem): Likewise.
(Build_Scaled_Divide_Code): Convert the result of the multiply.

10 days agoada: Fix typo in GNAT RM
Tonu Naks [Mon, 29 Sep 2025 07:18:47 +0000 (07:18 +0000)] 
ada: Fix typo in GNAT RM

gcc/ada/ChangeLog:

* doc/gnat_rm/obsolescent_features.rst: typo
* gnat_rm.texi: Regenerate.

10 days agoada: Unsigned_Base_Range aspect (part 5)
Javier Miranda [Mon, 15 Sep 2025 16:34:47 +0000 (16:34 +0000)] 
ada: Unsigned_Base_Range aspect (part 5)

Enable this language extension using -gnat.u, and extend the
current support to handle derivations of types that have
Unsigned_Base_Range aspect.

gcc/ada/ChangeLog:

* aspects.adb (Get_Aspect_Id): Enable aspect Unsigned_Base_Range
using -gnatd.u
* debug.adb (Debug_Flag_Dot_U): Document this switch.
* einfo-utils.adb (Is_Modular_Integer_Type): Return True if
the entity is a modular integer type and its base type does
not have the attribute has_unsigned_base_range_aspect.
(Is_Signed_Integer_Type): Return True if the entity is a signed
integer type, or it is a modular integer type and its base type
has the attribute has_unsigned_base_range_aspect.
* einfo.ads (E_Modular_Integer_Type): Add documentation of
Has_Unsigned_Base_Range_Aspect.
* par-ch4.adb (Scan_Apostrophe): Enable attribute Unsigned_Base_Range
using -gnatd.u
* sem_ch13.adb (Analyze_One_Aspect): Check general language
restrictions on aspect Unsigned_Base_Range. For Unsigned_Base_Range
aspect, do not delay the generation of the pragma becase we need
to process it before any type or subtype derivation is analyzed.
* sem_ch3.adb (Build_Scalar_Bound): Disable code analyzing the
bound with the base type of the parent type because, for unsigned
base range types, their base type is a modular type but their
type is a signed integer type.
* sem_prag.adb (Analyze_Pragma): Enable pragma Unsigned_Base_Range
using -gnatd.u. Check more errors on Unsigned_Base_Range pragma,
and create the new base type only when required.

10 days agoada: Fix usage of Table.Table in Sem_Ch12
Ronan Desplanques [Thu, 25 Sep 2025 09:33:13 +0000 (11:33 +0200)] 
ada: Fix usage of Table.Table in Sem_Ch12

Before this patch, Sem_Ch12 jumped through questionable hoops in the way
it used its Generics_Renaming table that involved defensive calls to the
'Valid attribute. No known bug has been caused by this, but valgrind
reported incorrect memory operations because of it.

After analysis, the problem seems to be a mix 0-based and 1-based
indexing in the uses of Generic_Renamings and a convoluted interface for
the Set_Instance_Of procedure, leading to an unclear status for
Generic_Renamings.Table (0).

This patch fixes those problems and removes the accompanying defensive
code.

gcc/ada/ChangeLog:

* sem_ch12.adb (Build_Local_Package)
(Analyze_Package_Instantiation, Analyze_Subprogram_Instantiation):
Fix Set_Last calls.
(Set_Instance_Of): Use Table.Table.Append.
(Save_And_Reset): Remove useless call. Remove defensive code.
(Restore): Remove incorrect Set_Last call and adapt to
Set_Instance_Of change.

10 days agoada: Fix crash when an invalid warning switch contains trailing spaces
Denis Mazzucato [Tue, 23 Sep 2025 15:38:52 +0000 (17:38 +0200)] 
ada: Fix crash when an invalid warning switch contains trailing spaces

This patch fixes the crash that happens when emitting the error message of an
invalid warning switch with trailing spaces.

gcc/ada/ChangeLog:

* sem_prag.adb (Analyze_Pragma): Add enclosing quotation when the
invalid switch ends with a space.

10 days agomatch.pd: simplify (view_convert (BIT_FIELD_REF))
Artemiy Volkov [Mon, 27 Oct 2025 14:47:31 +0000 (14:47 +0000)] 
match.pd: simplify (view_convert (BIT_FIELD_REF))

This patch adds a match.pd transformation to strip unnecessary
view_converts of BIT_FIELD_REFs.  This is only valid when the type of the
view_convert is a register type, and no loss of precision is involved when
casting to an integer type; both of these conditions are checked for in
the if clause of the new pattern.

The change survives bootstrap + regtest on aarch64 and x86_64, and one
additional test case has been added to gcc.dg/tree-ssa.

Changes since v1:
- Require is_gimple_reg_type (type) and remove conditions on @0
- Reword the commit message to reflect code changes

gcc/ChangeLog:

* match.pd: Add pattern to simplify view_convert (BIT_FIELD_REF).

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/forwprop-42.c: New test.

10 days agoOpenMP/Fortran: Skip context selectors that have OMP_TRAIT_INVALID [PR122439]
Paul-Antoine Arras [Mon, 27 Oct 2025 14:25:17 +0000 (15:25 +0100)] 
OpenMP/Fortran: Skip context selectors that have OMP_TRAIT_INVALID [PR122439]

This fixes a fallout of r16-4540-g80af807e52e4f4 that caused undefined
behaviour.

PR fortran/122439

gcc/fortran/ChangeLog:

* openmp.cc (gfc_resolve_omp_context_selector): Skip selectors that have
OMP_TRAIT_INVALID.

10 days agoAda: Fix instantiation failure for package with formal package parameters
Eric Botcazou [Tue, 28 Oct 2025 09:13:35 +0000 (10:13 +0100)] 
Ada: Fix instantiation failure for package with formal package parameters

The problem occurs for a generic package with a formal package parameter
that contains a nested generic package used in the instantiation of another
generic package with two formal package parameters.

It turns out that the mapping between formals and actuals for the latter two
formal package parameters done by Map_Formal_Package_Entities is blocked by
the presence of the first formal package parameter, more precisely by the
special name built for the formal in the parent of a child unit.  The fix
is just to set the Is_Internal flag on this special name.

gcc/ada/
PR ada/59234
* sem_ch12.adb (Analyze_Formal_Package_Declaration): Mark the
special name built for the formal in the parent of a child unit
as internal.

gcc/testsuite/
* gnat.dg/specs/generic_inst5.ads: New test.
* gnat.dg/specs/generic_inst5_pkg1.ads: New helper.
* gnat.dg/specs/generic_inst5_pkg2.ads: Likewise.

10 days agoAda: Fix generic formal subprogram with implicit default wrongly rejected
Eric Botcazou [Tue, 28 Oct 2025 08:56:33 +0000 (09:56 +0100)] 
Ada: Fix generic formal subprogram with implicit default wrongly rejected

It's another issue with a formal subprogram parameter of a generic unit,
whose default is specified by a box and the actual is omitted, so an
implicit actual with the name of the formal is used instead and resolved
in the context of the instance.

The problem is that, for a child generic unit, the parent unit needs to be
loaded during the instantiation, but it cannot be used to resolve implicit
actuals, which must be resolved in the context of the instance.  So an
ad-hoc mechanism is implemented to prune references to the parent unit(s)
for this resolution, but that's wrong if the parent unit was loaded at an
earlier point in the context of the instance.

The fix disables this ad-hoc mechanism in the case where the parent unit
has not been loaded during the instantiation by propagating the boolean
Parent_Installed flag through the call chain.

gcc/ada/
PR ada/34511
* sem_ch12.adb (Analyze_Associations): Add Parent_Installed formal
parameter and pass it in call to Analyze_One_Association.
(Analyze_One_Association): Add Parent_Installed formal parameter
and pass it in call to Instantiate_Formal_Subprogram.
(Analyze_Formal_Package_Declaration): Pass Parent_Installed in call
to Analyze_Associations.
(Analyze_Package_Instantiation): Likewise.
(Analyze_Subprogram_Instantiation): Likewise.
(Instantiate_Formal_Subprogram): Add Parent_Installed formal
parameter and prune references to the parent unit(s) only if
it is true.

gcc/testsuite/
* gnat.dg/specs/generic_inst4-child2.ads: New test.
* gnat.dg/specs/generic_inst4.ads: New helper.
* gnat.dg/specs/generic_inst4-child1.ads: Likewise.

10 days agoAdd missing dg-do directive
Eric Botcazou [Mon, 27 Oct 2025 21:41:01 +0000 (22:41 +0100)] 
Add missing dg-do directive

gcc/testsuite/
* gnat.dg/specs/generic_inst3.ads: Add dg-do directive.

10 days agolibgomp: Simplify 'parse_stacksize' call in 'libgomp/env.c:initialize_env'
Thomas Schwinge [Fri, 24 Oct 2025 07:59:53 +0000 (09:59 +0200)] 
libgomp: Simplify 'parse_stacksize' call in 'libgomp/env.c:initialize_env'

Minor fix-up for commit r13-2545-g9f2fca56593a2b87026b399d26adcdca90705685
"OpenMP, libgomp: Environment variable syntax extension".  Supplying an array
of three elements is misleading: 'parse_stacksize' only looks at 'params[0]'.
Just let the compiler figure out the array size (..., as done elsewhere, too).

libgomp/
* env.c (initialize_env): Simplify 'parse_stacksize' call.

10 days agoRISC-V: Clean up build warnings for VLS calling convention
Kito Cheng [Tue, 28 Oct 2025 02:15:53 +0000 (10:15 +0800)] 
RISC-V: Clean up build warnings for VLS calling convention

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_get_vls_cc_attr): Fix error message
parameter order and add check_only condition.  Improve diagnostic
message formatting with proper quoting.
(riscv_handle_rvv_vls_cc_attribute): Anonymize unused node parameter.

10 days agovect: Add vector lowering for MULT_EXPR for constant pow2 multiplication.
Avinash Jayakar [Tue, 28 Oct 2025 04:19:21 +0000 (09:49 +0530)] 
vect: Add vector lowering for MULT_EXPR for constant pow2 multiplication.

Use logic similar to lowering the vector operation for MULT_EXPR as done in
expand_mult in expmed.cc, but in this commit only bare bones version of what
is done in vect_synth_mult_by_constant is implemented that only works if
constant is a positive power of 2 constant.

Previously, if the source code is written in a vector dialect, for example the
vector types of altivec.h, the vectorizer would lower the MULT_EXPR to scalar
variant if the target did not support the vector insn for that type. But better
code could be generated had it recognized the pattern and transformed it to
shifts.
For example, this code

vector unsigned long long
lshift1_64_altivec (vector unsigned long long a)
{
  return a * (vector unsigned long long) { 4, 4 };
}

generates the scalar code in power8/9

        .cfi_startproc
        xxpermdi 0,34,34,3
        mfvsrd 9,34
        mfvsrd 10,0
        sldi 9,9,2
        mtvsrd 0,9
        sldi 10,10,2
        mtvsrd 34,10
        xxpermdi 34,0,34,0
        blr
        .long 0
        .byte 0,0,0,0,0,0,0,0
        .cfi_endproc

although it has a vector insn for left shift. With this change now the
following is generated

        .cfi_startproc
        lxvd2x 32,0,3
        vspltisw 1,2
        vsld 0,0,1
        stxvd2x 32,0,3
        blr
        .long 0
        .byte 0,0,0,0,0,0,0,0
        .cfi_endproc

2025-11-28  Avinash Jayakar  <avinashd@linux.ibm.com>

gcc/ChangeLog:
PR tree-optimization/122065
* tree-vect-generic.cc (add_rshift): Update name and add code parameter.
(add_shift): Update name.
(expand_vector_mult): New lowering for MULT_EXPR.
(expand_vector_divmod): Use updated function name.
(expand_vector_operation): Use updated function name.

10 days agolibgcobol: fix xmlCtxtGetVersion typo again
Sam James [Tue, 28 Oct 2025 00:06:24 +0000 (00:06 +0000)] 
libgcobol: fix xmlCtxtGetVersion typo again

Followup to r16-4668-g374ec67294fc4f. I'd assumed the build got past
this point but it turned out it hadn't.

libgcobol/ChangeLog:
PR cobol/122451

* xmlparse.cc (context_t): Make 'ctxt' public.
(xml_push_parse): Fix xmlCtxtGetVersion argument.

10 days agoDaily bump.
GCC Administrator [Tue, 28 Oct 2025 00:21:54 +0000 (00:21 +0000)] 
Daily bump.

10 days agoc++/modules: Propagate type of array with deduced size to its template [PR122422]
Nathaniel Shead [Sun, 26 Oct 2025 09:32:10 +0000 (20:32 +1100)] 
c++/modules: Propagate type of array with deduced size to its template [PR122422]

This is the same issue as solved in r16-1759-g98fd493db6216c for auto,
but this time for arrays with size deduced from their initializers.

PR c++/122422

gcc/cp/ChangeLog:

* decl.cc (maybe_deduce_size_from_array_init): Propagate type to
corresponding TEMPLATE_DECL.

gcc/testsuite/ChangeLog:

* g++.dg/modules/merge-20.h: New test.
* g++.dg/modules/merge-20_a.H: New test.
* g++.dg/modules/merge-20_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
10 days agoc++/modules: Use containing type as key for all member lambdas [PR122310]
Nathaniel Shead [Sat, 18 Oct 2025 12:43:14 +0000 (23:43 +1100)] 
c++/modules: Use containing type as key for all member lambdas [PR122310]

The ICE in the linked PR occurs because we first stream the lambda type
before its keyed decl has been streamed, but the key decl's type depends
on the lambda.  And so when streaming the key decl to check for an
existing decl to merge with, merging the key decl itself crashes because
its type has only been partially streamed.

This patch fixes the issue by generalising the existing FIELD_DECL
handling to any class member using the outermost containing TYPE_DECL as
its key type.  This way we can guarantee that the key decl has been
streamed before the lambda type is otherwise needed.

PR c++/122310

gcc/cp/ChangeLog:

* module.cc (get_keyed_decl_scope): New function.
(trees_out::get_merge_kind): Use it.
(trees_out::key_mergeable): Use it.
(maybe_key_decl): Key to the containing type for all members.

gcc/testsuite/ChangeLog:

* g++.dg/modules/lambda-12.h: New test.
* g++.dg/modules/lambda-12_a.H: New test.
* g++.dg/modules/lambda-12_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
10 days agoexpand: Move the [0,1] detection for a*b to use the ranger
Andrew Pinski [Sun, 26 Oct 2025 19:21:08 +0000 (12:21 -0700)] 
expand: Move the [0,1] detection for a*b to use the ranger

In r14-6418-gacbfb8b9495b, the detection of boolean range was moved
over to use gimple_zero_one_valued_p but now that we can use the full ranger
during expand, let's use that instead. Adds a new helper function called
expr_has_boolean_range.  This calls ssa_name_has_boolean_range when there
is an ssa name; otherwise checks the constant value for boolean[0,1].

An example is:
```
unsigned f(unsigned b, unsigned c, unsigned d)
{
  if (b <= 1)
    return b * c;
  return d;
}
```
Where before this would not try to expand as `c & -b` but we know that b has [0,1] range,
this will expand as `c & -b` for many targets.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

* expr.cc (expr_has_boolean_range): New function.
(expand_expr_real_2): Use expr_has_boolean_range instead of
gimple_zero_one_valued_p.
* tree-ssanames.cc (ssa_name_has_boolean_range): Update to take
a gimple STMT.
* tree-ssanames.h (ssa_name_has_boolean_range): Update for the new
argument and default to nullptr.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
10 days ago[PATCH] match: simplify `VCE<bool>({0,1}) ==/!= 0` to `{0,1} ==/!= 0` [PR105749]
Andrew Pinski [Mon, 6 Oct 2025 05:39:35 +0000 (22:39 -0700)] 
[PATCH] match: simplify `VCE<bool>({0,1}) ==/!= 0` to `{0,1} ==/!= 0` [PR105749]

SRA likes to create VCE<bool>(a) when it comes to bool. This confuses
a few different passes including jump threading and uninitialization
warning. This removes the VCE in one case where it will help and when it
is known not to have any undefined behavior since the ranges of a is known
to be 0/1.

This implements similar was done for PR 80635 but without VRP's help; ccp
provides enough on the range/non-zeroness to implement this in match.

This will fix many of the std::optional reported warnings at -O1 too.
pr80635-[34].C are the same as pr80635-[12].C but compiled at -O1 rather
than just -O2.

PR tree-optimization/105749
PR tree-optimization/80635

gcc/ChangeLog:

* match.pd (`VCE<bool>(zero_one_valued_p) ==\!= 0`): New pattern.

gcc/testsuite/ChangeLog:

* g++.dg/warn/pr80635-3.C: New test.
* g++.dg/warn/pr80635-4.C: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
10 days agolibgcobol: fix xmlCtxtGetVersion typo
Sam James [Mon, 27 Oct 2025 22:53:00 +0000 (22:53 +0000)] 
libgcobol: fix xmlCtxtGetVersion typo

libgcobol/ChangeLog:
PR cobol/122451

* xmlparse.cc (xml_push_parse): Fix xmlCtxtGetVersion argument
typo to be 'context'.

10 days agoc: Try the type with the previous function attributes
H.J. Lu [Sun, 26 Oct 2025 00:42:20 +0000 (08:42 +0800)] 
c: Try the type with the previous function attributes

When there are 2 conflicting function declarations, try the new type
with the previous TYPE_ATTRIBUTES if the current declaration has no
TYPE_ATTRIBUTES to support

extern void foo (void) __attribute__((nocf_check));

void
foo (void)
{
}

instead of issuing an error:

$ gcc -O2 -fcf-protection -S x.c
x.c:4:1: error: conflicting types for ‘foo’; have ‘void(void)’
    4 | foo (void)
      | ^~~
x.c:1:13: note: previous declaration of ‘foo’ with type ‘void(void)’
    1 | extern void foo (void) __attribute__((nocf_check));
      |             ^~~

The resulting function definition is compatible with the previous
declaration.

gcc/c/

PR c/122427
* c-decl.cc (diagnose_mismatched_decls): For FUNCTION_DECL, if
OLDDECL has TYPE_ATTRIBUTES and NEWDECL doesn't, try the type
with the OLDDECL attributes.

gcc/testsuite/

PR c/122427
* g++.target/i386/cf_check-1.C: New test.
* g++.target/i386/cf_check-2.C: Likewise.
* g++.target/i386/cf_check-3.C: Likewise.
* g++.target/i386/cf_check-4.C: Likewise.
* gcc.target/i386/cf_check-7.c: Likewise.
* gcc.target/i386/cf_check-8.c: Likewise.
* gcc.target/i386/cf_check-9.c: Likewise.
* gcc.target/i386/cf_check-10.c: Likewise.
* gcc.target/i386/cf_check-11.c: Likewise.
* gcc.target/i386/no-callee-saved-12.c: Remove dg-error.
* gcc.target/i386/preserve-none-17.c: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
10 days agoAda: Fix assertion failure on child generic package
Eric Botcazou [Mon, 27 Oct 2025 18:51:11 +0000 (19:51 +0100)] 
Ada: Fix assertion failure on child generic package

That's an oversight in Declare_Inherited_Private_Subprograms, which does
not deal with formal types specially as it should per RM 3.2.3(7.d/2).

gcc/ada/
PR ada/29958
* sem_ch7.adb (Declare_Inherited_Private_Subprograms): Deal with
formal types specially.

gcc/testsuite/
* gnat.dg/specs/private3-child.ads: New test.
* gnat.dg/specs/private3.ads: New helper.

10 days agolibstdc++: Add missing -pthread for new tests [PR122401]
Jonathan Wakely [Fri, 24 Oct 2025 10:38:22 +0000 (11:38 +0100)] 
libstdc++: Add missing -pthread for new tests [PR122401]

These new multithreaded tests need -pthread for targets that don't
include all pthreads symbols in libc (including older Glibc in
particular).

The 30_threads/shared_timed_mutex/try_lock_until/116586.cc test is not
fixed by this commit, because it needs a different fix for older Glibc.

libstdc++-v3/ChangeLog:

PR libstdc++/122401
* testsuite/20_util/shared_ptr/atomic/pr118757.cc: Add -pthread
for et pthread.
* testsuite/20_util/weak_ptr/pr118757.cc: Likewise.
* testsuite/30_threads/condition_variable/members/116586.cc:
Likewise. Only run for hosted targets with gthreads support.
* testsuite/30_threads/future/members/116586.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/116586.cc:
Likewise.
* testsuite/30_threads/timed_mutex/try_lock_until/116586.cc:
Likewise.

10 days agoAda: Fix visibility problem for implicit actual of formal subprogram
Eric Botcazou [Mon, 27 Oct 2025 18:10:49 +0000 (19:10 +0100)] 
Ada: Fix visibility problem for implicit actual of formal subprogram

If an actual parameter for a formal subprogram parameter of a generic unit,
whose default is specified by a box, is omitted then an implicit actual with
the name of the formal is used and resolved in the context of the instance.

If this context is a generic unit, and these implicit actuals are resolved
to global references, then these implicit actuals need to be retrofitted
into the unanalyzed copy of the generic unit, so that instances of this
generic unit do not resolve again the implicit actuals but inherit the
global references instead.

This works fine for instances whose name is a direct name but not for those
whose name is an expanded name (in GNAT parlance).  The patch also contains
a small cleanup for a related procedure.

gcc/ada/
PR ada/25988
* sem_ch12.adb (Save_Global_References.Reset_Entity): Also call
Save_Global_Defaults for instances with an expanded name.
(Save_Global_References.Save_References): Minor code cleanup.

gcc/testsuite/
* gnat.dg/specs/generic_inst3.ads: New test.
* gnat.dg/specs/generic_inst3_pkg1.ads: New helper.
* gnat.dg/specs/generic_inst3_pkg1.adb: New helper.
* gnat.dg/specs/generic_inst3_pkg2.ads: Likewise.
* gnat.dg/specs/generic_inst3_pkg3.ads: Likewise.
* gnat.dg/specs/generic_inst3_pkg3-child.ads: Likewise.

10 days agovect: Fix operand swapping on complex multiplication detection [PR122408]
Tamar Christina [Mon, 27 Oct 2025 17:55:38 +0000 (17:55 +0000)] 
vect: Fix operand swapping on complex multiplication detection [PR122408]

For

SUBROUTINE a( j, b, c, d )
  !GCC$ ATTRIBUTES noinline :: a
  COMPLEX*16         b
  COMPLEX*16         c( * ), d( * )
  DO k = 1, j
     c( k ) = - b * CONJG( d( k ) )
  END DO
END

we incorrectly generate .IFN_COMPLEX_MUL instead of .IFN_COMPLEX_MUL_CONJ.

The issue happens because in the call to vect_validate_multiplication the
operand vectors are passed by reference and so the stripping of the NEGATE_EXPR
after matching modifies the input vector.  If validation fail we flip the
operands and try again.  But we've already stipped the negates and so if we
match we would match a normal multiply.

This fixes the API by marking the operands as const and instead pass an explicit
output vec that's to be used.  This also reduces the number of copies we were
doing.

With this we now correctly detect .IFN_COMPLEX_MUL_CONJ.  Weirdly enough I
couldn't reproduce this with any C example because they get reassociated
differently and always succeed on the first attempt.  Fortran is easy to
trigger though so new fortran tests added.

gcc/ChangeLog:

PR tree-optimization/122408
* tree-vect-slp-patterns.cc (vect_validate_multiplication): Cleanup and
document interface.
(complex_mul_pattern::matches, complex_fms_pattern::matches): Update to
new interface.

gcc/testsuite/ChangeLog:

PR tree-optimization/122408
* gfortran.target/aarch64/pr122408_1.f90: New test.
* gfortran.target/aarch64/pr122408_2.f90: New test.

10 days agoVarious fixes for XML PARSE.
James K. Lowden [Mon, 27 Oct 2025 17:36:10 +0000 (13:36 -0400)] 
Various fixes for XML PARSE.

Annotate unused parameters.  Do not compile some functions that might
not be needed.  Consistent with libgcobol, log errors via syslog(3).
Introduce push-parser as experiment.

libgcobol/ChangeLog: Correct warnings and errors in xmlparse.cc.

* xmlparse.cc (CTX): Macro for unused user-context parameter.
(attributeDecl): Mark unused parameters.
(cdataBlock): Same.
(characters): Same.
(comment): Same.
(elementDecl): Same.
(endDocument): Same.
(endElementNs): Same.
(endElement): Same.
(entityDecl): Same.
(error): Same.
(externalSubset): Same.
(fatalError): Same.
(getEntity): Eliminate via preprocessor until needed.
(getParameterEntity): Same.
(hasExternalSubset): Mark unused parameters.
(hasInternalSubset): Same.
(ignorableWhitespace): Same.
(internalSubset): Same.
(isStandalone): Eliminate via preprocessor until needed.
(notationDecl): Mark unused parameters.
(processingInstruction): Same.
(reference): Same.
(resolveEntity): Eliminate via preprocessor until needed.
(setDocumentLocator): Mark unused parameters.
(startDocument): Same.
(startElementNs): Same.
(startElement): Same.
(unparsedEntityDecl): Same.
(warning): Same.
(xmlchar_of): Utility cast function.
(xmlParserErrors_str): Message string for libxml2 errors.
(xmlerror_str): Macro to include textual form of libxml2 error.
(context_t): Push-parser context class.
(xml_push_parse): Use push-parser.
(__gg__xml_parse_done): Signify end-of-input to XML push-parser.
(__gg__xml_parse): Mark unused parameters.

10 days agophiopt: Fix up DEBUG_EXPR_DECL creation in spaceship_replacement [PR122394]
Jakub Jelinek [Mon, 27 Oct 2025 16:40:47 +0000 (17:40 +0100)] 
phiopt: Fix up DEBUG_EXPR_DECL creation in spaceship_replacement [PR122394]

The following testcase ICEs in gcc 15 (and is at least latent in 12-14 too),
because the DEBUG_EXPR_DECL has incorrect mode.  It has
TREE_TYPE (orig_use_lhs) type, but TYPE_MODE (type) rather than
TYPE_MODE (TREE_TYPE (orig_use_lhs)) where the two types are sometimes
the same, but sometimes different (same if !has_cast_debug_uses, different
otherwise).

Though, there wouldn't be the this issue if it used the proper API to create
the DEBUG_EXPR_DECL which takes care of everything.  This is the sole
spot that doesn't use that API.

Doesn't affect the trunk because the code has been removed and replaced with
different stuff after the libstdc++ ABI change in r16-3474.
Before r15-5557 the mode has been always wrong because this was done only
for has_cast_debug_uses.  And the bug has been introduced with r12-5490.

Enough archeology, while it could be fixed by changing the second
SET_DECL_MODE argument, I think it is better to use build_debug_expr_decl.

On the trunk only the testcase is being added.

2025-10-27  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/122394
* g++.dg/opt/pr122394.C: New test.

10 days agoamdgcn: Implement vector ABS_EXPR for integers (PR104116)
Andrew Stubbs [Fri, 24 Oct 2025 10:41:40 +0000 (10:41 +0000)] 
amdgcn: Implement vector ABS_EXPR for integers (PR104116)

There's not a single vector instruction for integer absolute, but this
enables the optimization in PR104116, and is probably useful otherwise.

The pr104116-*.c testcases should now pass on amdgcn.

gcc/ChangeLog:

PR tree-optimization/104116
* config/gcn/gcn-valu.md (abs<mode>2): New define_expand for
integer vector modes.

10 days agoSkip riscv/rvv/xtheadvector/pr116593.C if not hostedlib
Olivier Hainque [Tue, 15 Apr 2025 15:23:35 +0000 (17:23 +0200)] 
Skip riscv/rvv/xtheadvector/pr116593.C if not hostedlib

As it requires C++ "vector" support, not available in freestanding
environments.

testsuite/
* g++.target/riscv/rvv/xtheadvector/pr116593.C: Skip if !hostedlib.

11 days agoOpenMP/C++: Fix label mangling in metadirective body [PR122378]
Paul-Antoine Arras [Fri, 24 Oct 2025 09:05:27 +0000 (11:05 +0200)] 
OpenMP/C++: Fix label mangling in metadirective body [PR122378]

Testcase c-c++-common/gomp/attrs-metadirective-2.c failed in C++ when
OFFLOAD_TARGET_NAMES=nvptx-none. That was caused by label mangling being applied
to the use but not to the declaration.
This is now fixed by mangling the declaration as well.

PR c++/122378

gcc/cp/ChangeLog:

* parser.cc (cp_parser_label_declaration): Mangle label declaration in a
metadirective region.

11 days agoFortran: Fix ICE due to PDT selector expression in ASSOCIATE [PR95541]
Paul Thomas [Mon, 27 Oct 2025 14:19:33 +0000 (14:19 +0000)] 
Fortran: Fix ICE due to PDT selector expression in ASSOCIATE [PR95541]

2025-10-27  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/922290
* resolve.cc (resolve_typebound_intrinsic_op): Add pdt_template
to the list of preemted specifics.

PR fortran/95541
* trans-stmt.cc (trans_associate_var): PDT array and string
components are separately allocated for each element of a PDT
array, so copy in and copy out the selector expression.

gcc/testsuite/
PR fortran/95541
* gfortran.dg/pdt_61.f03: New test.

11 days agoXFAIL test for PR 111003.
Andrew MacLeod [Mon, 27 Oct 2025 14:02:21 +0000 (10:02 -0400)] 
XFAIL test for PR 111003.

The change to 118254 uncovered the latent bug in 111003, reopened and
xfailed current test.

PR tree-optimization/111003
* gcc.dg/tree-ssa/pr111003.c: XFAIL.

11 days agoCleanup flag_complex_method further
Richard Biener [Mon, 20 Oct 2025 08:20:18 +0000 (10:20 +0200)] 
Cleanup flag_complex_method further

PR122325 reports that -ffast-math no longer enables -fcx-limited-range.
This is due to the weird handling of flag_default_complex_method which
the following simply removes.  Frontends that wish to impose a default
evaluation method that is not -fcx-fortran-rules (the current default
of flag_default_complex_method) need to imposed that in ther
init_options_struct langhook which those requesting C std rules already
do and I'm adding that for the fortran frontend, explicitly requesting
fortran rules.

PR middle-end/122325
gcc/
* common.opt (flag_default_complex_method): Remove.
* opts.cc (init_options_struct): Default to fortran rules
for complex evaluations.
(finish_options): Remove (re-)instantiating of the frontend
default of the complex evaluation method.

gcc/c-family/
* c-opts.cc (c_common_init_options_struct): Remove set of
flag_default_complex_method.

gcc/go/
* go-lang.cc (go_langhook_init_options_struct): Remove set of
flag_default_complex_method.

gcc/lto/
* lto-lang.cc (lto_init_options_struct): Remove set of
flag_default_complex_method.

gcc/fortran/
* options.cc (gfc_init_options_struct): Set flag_complex_method
to fortran rules.

gcc/testsuite/
* gcc.dg/complex-8.c: New testcase.
* gcc.dg/complex-9.c: Likewise.

11 days agoRISC-V: Add testsuite for fixed-length vector calling convention variant [Part 2]
Kito Cheng [Thu, 16 Oct 2025 08:43:05 +0000 (16:43 +0800)] 
RISC-V: Add testsuite for fixed-length vector calling convention variant [Part 2]

Add comprehensive testsuite for VLS calling convention covering various
ABI_VLEN (32, 64, 128, 256, 512) and XLEN (32, 64) combinations. Tests
include single vectors, structs, unions, register exhaustion, and mixed
type scenarios.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_128bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_256bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_32bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_64bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_all_mixed.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_equivalent_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_four_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_mixed_args.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_mixed_int_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_mixed_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_multiple_unions.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_multiple_vectors.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_simple_union.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_single_register.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_two_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-32/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_128bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_256bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_32bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_64bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_all_mixed.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_equivalent_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_four_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_mixed_args.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_mixed_int_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_mixed_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_multiple_unions.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_multiple_vectors.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_simple_union.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_single_register.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_two_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-32-xlen-64/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_128bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_256bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_32bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_64bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_all_mixed.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_equivalent_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_four_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_mixed_args.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_mixed_int_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_mixed_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_multiple_unions.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_multiple_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_simple_union.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_single_register.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_two_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-32/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_128bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_256bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_32bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_64bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_all_mixed.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_equivalent_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_four_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_mixed_args.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_mixed_int_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_mixed_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_multiple_unions.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_multiple_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_simple_union.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_single_register.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_two_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-512-xlen-64/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_128bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_256bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_32bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_64bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_all_mixed.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_equivalent_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_four_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_fp_vs_int_vectors.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_mixed_args.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_mixed_int_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_mixed_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_multiple_unions.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_multiple_vectors.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_simple_union.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_single_register.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_two_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-32/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_128bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_256bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_32bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_64bit_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_all_mixed.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_equivalent_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_four_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_fp_vs_int_vectors.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_mixed_args.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_mixed_int_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_mixed_struct.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_multiple_unions.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_multiple_vectors.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_simple_union.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_single_register.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_two_registers.c: New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-64-xlen-64/test_vector_array_struct.c:
New test.

11 days agoRISC-V: Add testsuite for fixed-length vector calling convention variant [Part 1]
Kito Cheng [Thu, 16 Oct 2025 08:41:48 +0000 (16:41 +0800)] 
RISC-V: Add testsuite for fixed-length vector calling convention variant [Part 1]

Add comprehensive testsuite for VLS calling convention covering various
ABI_VLEN (128, 256) and XLEN (32, 64) combinations. Tests include single
vectors, structs, unions, register exhaustion, and mixed type scenarios.

This patch adds the test infrastructure and tests for ABI_VLEN 128 and 256.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_128bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_256bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_32bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_64bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_all_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_equivalent_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_four_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_mixed_args.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_mixed_int_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_mixed_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_multiple_unions.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_multiple_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_simple_union.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_single_register.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_two_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-32/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_128bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_256bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_32bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_64bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_all_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_equivalent_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_four_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_mixed_args.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_mixed_int_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_mixed_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_multiple_unions.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_multiple_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_simple_union.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_single_register.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_two_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-128-xlen-64/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_128bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_256bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_32bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_64bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_all_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_equivalent_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_four_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_mixed_args.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_mixed_int_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_mixed_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_multiple_unions.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_multiple_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_simple_union.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_single_register.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_two_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-32/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_128bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_256bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_32bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_64bit_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_all_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_call_mixed_function.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_different_vector_elements.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_different_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_different_width_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_equivalent_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_four_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_fp_vs_int_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_large_vector_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_mixed_args.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_mixed_float_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_mixed_int_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_mixed_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_mixed_struct_advanced.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_mixed_vector_types_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_multiple_unions.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_multiple_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_multiple_with_small_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_register_exhaustion.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_register_exhaustion_mixed.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_register_pressure_scenarios.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_same_vectors_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_simple_union.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_single_register.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_single_vector_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_struct_different_abi_vlen.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_struct_eight_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_struct_five_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_struct_four_256bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_struct_nine_128bit_vectors.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_two_registers.c:
New test.
* gcc.target/riscv/rvv/vls-cc/abi-vlen-256-xlen-64/test_vector_array_struct.c:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_128bit_vector.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_256bit_vector.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_32bit_vector.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_64bit_vector.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_all_mixed.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_call_mixed_function.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_different_vector_elements.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_different_vectors_struct.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_different_width_vectors_struct.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_equivalent_struct.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_four_registers.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_fp_vs_int_vectors.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_large_vector_small_abi_vlen.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_mixed_args.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_mixed_float_vector.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_mixed_int_vector.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_mixed_struct.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_mixed_struct_advanced.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_mixed_vector_types_struct.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_multiple_unions.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_multiple_vectors.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_multiple_with_small_abi_vlen.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_register_exhaustion.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_register_exhaustion_mixed.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_register_pressure_scenarios.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_same_vectors_struct.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_simple_union.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_single_register.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_single_vector_struct.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_struct_different_abi_vlen.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_struct_eight_128bit_vectors.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_struct_five_256bit_vectors.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_struct_four_256bit_vectors.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_struct_nine_128bit_vectors.h:
New test.
* gcc.target/riscv/rvv/vls-cc/common/test_two_registers.h: New test.
* gcc.target/riscv/rvv/vls-cc/common/test_vector_array_struct.h: New test.
* gcc.target/riscv/rvv/vls-cc/riscv-vls-cc.exp: New test.
* gcc.target/riscv/rvv/vls-cc/test_128_abi_vlen_large_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/test_128_abi_vlen_medium_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/test_256_abi_vlen_large_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/test_256_abi_vlen_very_large_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/test_32_abi_vlen_medium_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/test_32_abi_vlen_small_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/test_64_abi_vlen_medium_vector.c:
New test.
* gcc.target/riscv/rvv/vls-cc/test_64_abi_vlen_small_vector.c: New test.
* gcc.target/riscv/rvv/vls-cc/vls-cc-common.h: New test.

11 days agoRISC-V: Implement standard fixed-length vector calling convention variant
Kito Cheng [Fri, 8 Aug 2025 01:10:56 +0000 (09:10 +0800)] 
RISC-V: Implement standard fixed-length vector calling convention variant

This patch implements the standard fixed-length vector calling convention
variant as specified in the RISC-V ELF psABI document. The implementation
introduces ABI_VLEN to serve as the minimal VLEN for fixed-length vectors.

For example, int32x8_t is a 256-bit vector type. If ABI_VLEN is 128, it
will be passed in two vector registers as LMUL 2. If ABI_VLEN is larger
than 256, it will be passed in one vector register as LMUL 1.

This differs from the minimal VLEN (defined by ZVL*B extension) to ensure
ABI stability when the program compiles with different VLEN/ZVL*B settings.

Change since v1:
- Adding check_only parameter for several functions to make sure we
  won't emit warnings during checking function ABI.

Ref: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/418

gcc/ChangeLog:

* config/riscv/riscv-protos.h (riscv_init_cumulative_args): Add
bool parameter.
* config/riscv/riscv.h (enum riscv_cc): Add RISCV_CC_VLS_V_32,
RISCV_CC_VLS_V_64, RISCV_CC_VLS_V_128, RISCV_CC_VLS_V_256,
RISCV_CC_VLS_V_512, RISCV_CC_VLS_V_1024, RISCV_CC_VLS_V_2048,
RISCV_CC_VLS_V_4096, RISCV_CC_VLS_V_8192, RISCV_CC_VLS_V_16384.
(CUMULATIVE_ARGS): Add abi_vlen field.
* config/riscv/riscv.cc (riscv_handle_rvv_vls_cc_attribute): New
function.
(riscv_gnu_attributes): Add vls_cc attribute entry.
(riscv_attributes): Add riscv_vls_cc attribute entry.
(riscv_flatten_aggregate_field): Add vls_p and abi_vlen parameters
to handle VLS vector types.
(riscv_flatten_aggregate_argument): Update call to
riscv_flatten_aggregate_field.
(riscv_get_vector_arg): Add vls_p parameter for VLS handling.
(riscv_vls_cc_p): New function.
(riscv_get_cc_abi_vlen): New function.
(riscv_valid_abi_vlen_vls_cc_p): New function.
(riscv_get_riscv_cc_by_abi_vlen): New function.
(riscv_get_vls_container_type): New function.
(riscv_pass_vls_in_vr): New function.
(riscv_pass_aggregate_in_vr): New function.
(riscv_get_arg_info): Add VLS calling convention handling.
(riscv_function_arg_advance): Update for VLS calling convention.
(riscv_return_in_memory): Add fntype parameter and initialize
cumulative args properly.
(riscv_v_abi): Add abi parameter.
(riscv_get_vls_cc_attr): New function.
(riscv_vls_cc_function_abi): New function.
(riscv_fntype_abi): Add VLS calling convention detection.
(riscv_asm_output_variant_cc): Update for VLS calling convention.

11 days ago[RISC-V][PR target/64345][PR tree-optimization/80770] Improve simple bit extractions...
Jeff Law [Mon, 27 Oct 2025 12:58:09 +0000 (06:58 -0600)] 
[RISC-V][PR target/64345][PR tree-optimization/80770] Improve simple bit extractions on RISC-V

Whee.  So what got me wandering down this path was looking for a good bug for
Shreya or Austin and concluding this one would be dreadful for both 🙂

We're basically looking at single bit extractions where there's a bit-not
somewhere in the sequence.

A few examples for the motivating PR64345.  They were for the SH, but aren't
handled well for RISC-V either.

> unsigned int test0 (unsigned int x)
> {
>   return ((x >> 4) ^ 1) & 1;
> }
>
> unsigned int test1 (unsigned int x)
> {
>   return ((x >> 4) & 1) ^ 1;
> }
>
> unsigned int test2 (unsigned int x)
> {
>   return ~(x >> 4) & 1;
> }

Right now those generates sequences like this:

>         li      a5,1
>         srliw   a0,a0,4
>         andn    a0,a5,a0

But we can do better.  This is semantically equivalent, two bytes shorter and
at least as fast.

>         xori    a0,a0,16        # 8     [c=4 l=4]  *xordi3/1
>         bexti   a0,a0,4 # 16    [c=4 l=4]  *bexti

The core problem is the little white lie we have for and-not:

> (define_insn_and_split "*<optab>_not_const<mode>"
>   [(set (match_operand:X 0 "register_operand" "=r")
>        (bitmanip_bitwise:X (not:X (match_operand:X 1 "register_operand" "r"))
>               (match_operand:X 2 "const_arith_operand" "I")))

There is no such insn.  andn, orn, xorn do not accept constants. But pretending
we do may help generate better performing code in some cases.

That pattern is a single insn from combine's standpoint.  So when we see this:

> Trying 6 -> 10:
>     6: r140:DI=zero_extract(r145:DI,0x1c,0x4)
>       REG_DEAD r145:DI
>    10: {r143:DI=~r140:DI&0x1;clobber scratch;}
>       REG_DEAD r140:DI
> Failed to match this instruction:
> (parallel [
>         (set (reg:DI 143)
>             (zero_extract:DI (xor:DI (reg:DI 145 [ x ])
>                     (const_int 16 [0x10]))
>                 (const_int 1 [0x1])
>                 (const_int 4 [0x4])))
>         (clobber (scratch:DI))
>     ])

We can't split it because the result would be 2 insns and it was already 2
insns from combine's standpoint (the little while lie shows up in insn 10 which
is really 2 instructions, but just one insn).

I looked at the wacky possibility of making the problem pattern only available
after reload in the hopes that late-combine could generate it, but late-combine
doesn't handle scratches/clobbers like that.

I consider the cases where the lie helps code generation very much on the
margins and realized that we could turn it into a peephole2.  That way we don't
regress on those marginal cases, but the problem pattern doesn't get in the way
of combine's work.

So that's a good first step. But not entirely sufficient to get the best
possible code for those tests.  In particular, given equal costs this patch
also steers towards AND which has the advantage that on an OoO core the
constant load in that case can sometimes issue for free or it might be
encodable directly as well.  On an in-order core it gives the scheduler more
freedom.

There's a bit of tension on that topic and some issues I'm not trying to tackle
at this time.  Essentially in the sign-bit-splat path, depending on the
constants different paths might be preferred (particularly when there's a NOT
in the sequence).  It's on the margins and touched on by a different BZ.

The net is we can fix the various extraction problems on RISC-V exposed by the
testcases in PR64345 without regressing the minor and-not cases the
define_insn_and_split was handling with one less define_insn_and_split in the
port.  It likely improves pr80770 as well, though I haven't checked that.

Bootstrapped and regression tested on both the Pioneer and BPI.  Also
regression tested on riscv64-elf and riscv32-elf.  And since this touched
ifcvt.cc, bootstrapped and regression tested on x86_64 as well 🙂  It's also
regression tested across all the embedded targets in my tester.

PR target/64345
PR tree-optimization/80770
gcc/

* config/riscv/bitmanip.md (<optab>_not_const<mode>): Turn into a
peephole2 to avoid matching prior to combine.
* ifcvt.cc (noce_try_sign_bit_splat): When costs are equal steer
towards an AND based sequence.

gcc/testsuite/
* gcc.target/riscv/pr120553-2.c: Update expected output.
* gcc.target/riscv/pr64345.c: New test.
* gcc.target/riscv/zbb-andn-orn-01.c: Skip when peephole2 isn't run.
* gcc.target/riscv/zbb-andn-orn-02.c: Likewise.

11 days agotree-optimization/122419 - reduction chain with conversion as op
Richard Biener [Mon, 27 Oct 2025 10:31:32 +0000 (11:31 +0100)] 
tree-optimization/122419 - reduction chain with conversion as op

The following deals with reduction detection handling a non-noop
conversion as reduction operation and makes the reduction chain
chain re-discovery handle this situation the same.

PR tree-optimization/122419
* tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Only
skip noop conversions.

* gcc.dg/vect/pr122419.c: New testcase.

11 days agotree-optimization/122435 - missed redundant store removal
Richard Biener [Mon, 27 Oct 2025 10:15:17 +0000 (11:15 +0100)] 
tree-optimization/122435 - missed redundant store removal

The following removes a noop store that just performs a type sign
change.

PR tree-optimization/122435
* tree-ssa-sccvn.cc (eliminate_dom_walker::eliminate_stmt):
Also match noop conversions when detecting redundant stores.

* gcc.dg/tree-ssa/ssa-fre-111.c: New testcase.

11 days agolibstdc++: New _IotaArray utility to simplify index pack creation
Matthias Kretz [Fri, 24 Oct 2025 11:28:29 +0000 (13:28 +0200)] 
libstdc++: New _IotaArray utility to simplify index pack creation

This patch introduces the internal helper type _IotaArray to simplify
defining a pack of indices via a structured binding declaration:
constexpr auto [...__is] = _IotaArray<N>;

_IotaArray is a C-array for lowest overhead in terms of template
instantiations. Non-GCC compilers that do not implement
__integer_pack have a slightly higher overhead.

libstdc++-v3/ChangeLog:

* include/bits/utility.h (_IotaArray): Define.
* testsuite/ext/iotaarray.cc: New test.

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
11 days agox86: Compile builtin-copysign-8b.c with -mtune=generic
H.J. Lu [Mon, 27 Oct 2025 10:11:25 +0000 (18:11 +0800)] 
x86: Compile builtin-copysign-8b.c with -mtune=generic

Compile builtin-copysign-8b.c with -mtune=generic so that it passes with

$ make check-gcc RUNTESTFLAGS="i386.exp=builtin-copysign-8b.c --target_board='unix{-m64\ -march=cascadelake}'"

PR target/122323
* gcc.target/i386/builtin-copysign-8b.c: Add -mtune=generic.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
11 days agolibstdc++: Make std::valarray support overaligned types [PR108951]
Jonathan Wakely [Fri, 24 Oct 2025 11:56:04 +0000 (12:56 +0100)] 
libstdc++: Make std::valarray support overaligned types [PR108951]

Switch std::valarray<T> memory allocation to use std::__new_allocator<T>
to allocate and deallocate memory. This adds support for extended
alignment types without needing to duplicate all the logic from
__new_allocator::allocate and __new_allocator::dellocate.

std::__new_allocator is used instead of std::allocator because we want
to ensure that the memory is still allocated with operator new, so we
don't want to use any possible program-defined specialization of
std::allocator<T> which the user might have provided.

To make using an allocator possible, __valarray_release_memory needs to
become a function template so that it knows the type T. It also needs an
additional parameter specifying the size of the allocation.

This change doesn't cause an ABI change for types with fundamental
alignment, because __new_allocator still uses the same operator delete
function (or the sized version, which is ABI compatible) to free the
memory. So if memory for a valarray is allocated in one translation unit
and deallocated in another, and those TUs are compiled with different
versions of GCC, we still get memory from the same operator new and
release it with the same operator delete (or the compatibled sized
version). For types with extended alignment this does potentially cause
an ABI change on targets where the aligned version of operator delete
doesn't just call free(p), but support for extended alignment types was
previously just broken and had undefined behaviour.

libstdc++-v3/ChangeLog:

PR libstdc++/108951
* include/bits/valarray_array.h( __valarray_get_storage): Use
std::__new_allocator.
(__valarray_release_memory): Likewise.
* include/std/valarray: Pass _M_size to
__valarray_release_memory.
* testsuite/26_numerics/valarray/108951.cc: New test.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agolibstdc++: Add typedefs to __gnu_test::test_container utility
Jonathan Wakely [Tue, 21 Oct 2025 23:48:23 +0000 (00:48 +0100)] 
libstdc++: Add typedefs to __gnu_test::test_container utility

libstdc++-v3/ChangeLog:

* testsuite/util/testsuite_iterators.h (test_container): Add
iterator and value_type typedefs.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
11 days agoLoongArch: Adjust widen-mul rtx cost
Guo Jie [Sat, 25 Oct 2025 02:43:36 +0000 (10:43 +0800)] 
LoongArch: Adjust widen-mul rtx cost

Equalize the rtx cost of mulw.d.w[u] with mul.d.

There are two main benefits:
1. Reducing the number of instructions.
    -       lu32i.d $r12,0
    -       bstrpick.d $r4,$r4,31,0
    -       mul.d $r4,$r4,$r12
    -       srli.d $r4,$r4,33
    ---
    +       mulh.wu $r4,$r4,$r12
    +       bstrpick.d $r4,$r4,31,1

2. Help with the replacement of the high-latency div.w.
    -       addi.w $r12,$r0,3
    -       div.w $r4,$r4,$r12
    ---
    +       lu12i.w $r13,349525
    +       ori $r13,$r13,1366
    +       mulw.d.w $r12,$r4,$r13
    +       srai.w  $r4,$r4,31
    +       srli.d $r12,$r12,32
    +       sub.w $r4,$r12,$r4

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_rtx_costs):
Ignore the cost impact of SIGN_EXTEND/ZERO_EXTEND.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/widen-mul-rtx-cost-signed.c: New test.
* gcc.target/loongarch/widen-mul-rtx-cost-unsigned.c: New test.

11 days agoLoongArch: Optimize the non-zero check for both integers
Guo Jie [Sat, 25 Oct 2025 07:24:37 +0000 (15:24 +0800)] 
LoongArch: Optimize the non-zero check for both integers

Before:
sltu    $r5,$r0,$r5
        sltu    $r4,$r0,$r4
        and     $r4,$r5,$r4
After:
sltu    $r4,$r0,$r4
        maskeqz $r4,$r4,$r5

gcc/ChangeLog:

* config/loongarch/loongarch.md (both_non_zero): New combiner.
(both_non_zero_subreg): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/compare-both-non-zero.c: New test.

11 days agoLoongArch: Add a combiner to eliminate redundant extension
Guo Jie [Sat, 25 Oct 2025 02:33:49 +0000 (10:33 +0800)] 
LoongArch: Add a combiner to eliminate redundant extension

When the bit width of the data type before extension plus
the bit count of the left-shift operation equals 32,
optimizations similar to the following can from:
ext.w.b $r4,$r5
slli.d  $r4,$r4,24
to:
slli.w  $r4,$r5,24

gcc/ChangeLog:

* config/loongarch/loongarch.md
(sign_extend_ashift<GPR:mode><SHORT:mode>): New combiner.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/sign_extend_ashift.c: New test.

11 days agoIncrease NUM_ABI_IDS to support RISC-V VLS calling convention variants
Kito Cheng [Fri, 8 Aug 2025 01:00:59 +0000 (09:00 +0800)] 
Increase NUM_ABI_IDS to support RISC-V VLS calling convention variants

The RISC-V fixed-length vector calling convention introduces multiple ABI
variants based on different ABI_VLEN values. Each variant requires a
separate ABI ID to maintain proper ABI compatibility tracking in GCC.
Increase NUM_ABI_IDS from 8 to 12 to accommodate these additional ABI
variants.

gcc/ChangeLog:

* function-abi.h (NUM_ABI_IDS): Increase from 8 to 12.

11 days agoAda: Fix segfault on mutually recursive record type declarations
Eric Botcazou [Mon, 27 Oct 2025 08:53:57 +0000 (09:53 +0100)] 
Ada: Fix segfault on mutually recursive record type declarations

This was reported a long time ago and is again a fairly pathological case,
but it turns out to be unfixable with the current model of type freezing
in GNAT (which is the second one suggested in the AARM 13.14(19.i) clause).

The code is legal but, as the declaration of any object of the types will
exhaust the heap and eventually raise Storage_Error, it is totally useless.

The patch contains a small cleanup in a related area as well as the addition
of a commented assertion in gigi, so that the compiler shuts down properly.

gcc/ada/
PR ada/15800
* freeze.adb (Freeze_Entity.Freeze_Record_Type): Small cleanup
in code and comments.
* gcc-interface/utils.cc (create_field_decl): Assert that the type
of the field is frozen at this point.

11 days agoxtensa: Revert "xtensa: Make one_cmplsi2 optimizer-friendly"
Takayuki 'January June' Suwa [Sun, 26 Oct 2025 21:32:09 +0000 (06:32 +0900)] 
xtensa: Revert "xtensa: Make one_cmplsi2 optimizer-friendly"

This patch effectively revert the past commit 9777d446e2148ef9a6e9f35db3f4eab99ee8812c.

Almost the only reason we committed that was because some optimizers in the
RTL ifcvt pass needed '(set (reg) (not (reg)))' RTX, however, in recent
versions of gcc, the equivalent optimizations are performed before RTL
passes, so the need for that commit has all but disappeared.

     /* example 1 */
     int test0(int a) {
       return a < 0 ? ~a : a;
     }

     ;; result 1
     test0:
      entry sp, 32
      srai a8, a2, 31 ;; If-conversion before RTL expansion
      xor a2, a8, a2
      retw.n

Instead, expanding it to an XOR with a pseudo whose value of -1 early in
the RTL passes will take advantage of CSE, forward propagation, or loop-
invariant hoisting.

     /* example 2 */
     long long test1(long long a) {
       return ~a;
     }
     void test2(int a[]) {
       int i;
       for (i = 0; i < 16; ++i)
         a[i] = ~a[i];
     }

     ;; result 2
     test1:
      entry sp, 32
      movi.n a8, -1 ;; consolidated by CSE
      xor a2, a2, a8
      xor a3, a3, a8
      retw.n
     test2:
      entry sp, 32
      movi.n a10, -1 ;; hoisted out
      movi.n a9, 0x10
      loop a9, .L5_LEND
     .L5:
      l32i.n a8, a2, 0
      xor a8, a8, a10
      s32i.n a8, a2, 0
      addi.n a2, a2, 4
      .L5_LEND:
      retw.n

Another concern with reverting that commit is the impact on complex insns
that have '(not)' as part of them, but also nothing to worry about; because
the RTL insn combiner can correctly recognize an XOR with a register value
of -1 as a one's complement operation even without such RTX, and apply the
result to subsequent combine operations.

gcc/ChangeLog:

* config/xtensa/xtensa.md (one_cmplsi2):
Rearrange back as an expand pattern.

gcc/testsuite/ChangeLog:

* gcc.target/xtensa/one_cmpl_abs.c: Remove.

11 days ago[committed][MAINTAINERS]: Change email address in MAINTAINERS.
Jennifer Schmitz [Mon, 27 Oct 2025 08:24:50 +0000 (09:24 +0100)] 
[committed][MAINTAINERS]: Change email address in MAINTAINERS.

As I will be leaving my position at NVIDIA at the end of the month,
I am changing  my email address in the MAINTAINERS file to my
private one.

Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
ChangeLog:
* MAINTAINERS: Change email address.

11 days agoforwprop: Fix copy prop for alignment after the final folding [PR122086]
Andrew Pinski [Sat, 25 Oct 2025 00:13:26 +0000 (17:13 -0700)] 
forwprop: Fix copy prop for alignment after the final folding [PR122086]

After r16-4081-g966cdec2b2 which added folding of __builtin_assume_aligned,
forwprop would propagate pointers that lower alignment replacing ones with
greater alignment. This causes us to lose alignment information that
__builtin_assume_aligned provided to expand.  Normally this just loses some
optimizations except in the s390 case where the alignment is specifically
checked and was for inlining of the atomics; without this patch an infininite
loop would happen.

Note this was previously broken for -Og before r16-4081-g966cdec2b2. This
fixes -Og case as forwprop is used instead of copyprop.

This moves the testcase for pr107389.c to torture to get a generic testcase.
pr107389.c was originally for -O0 case but we should test for other
optimization levels so this is not lost again.

align-5.c is xfailed because __builtin_assume_aligned is not instrumented for ubsan
alignment and ubsan check to see pointer is aligned before emitting a check for the
load (based on the known alignment in compiling). See PR 122038 too. I had mentioned
this issue previously in r16-4081-g966cdec2b2 too.

PR middle-end/107389
PR tree-optimization/122086
gcc/ChangeLog:

* tree-ssa-forwprop.cc (forwprop_may_propagate_copy): New function.
(pass_forwprop::execute):  Use forwprop_may_propagate_copy
instead of may_propagate_copy.

gcc/testsuite/ChangeLog:

* gcc.dg/pr107389.c: Move to...
* gcc.dg/torture/pr107389.c: ...here. Skip for lto.
Use dg-additional-options rather than dg-options.
* c-c++-common/ubsan/align-5.c: xfail.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
11 days agoDaily bump.
GCC Administrator [Mon, 27 Oct 2025 00:19:00 +0000 (00:19 +0000)] 
Daily bump.

11 days agoriscv: Fix gimple folding of the vset* intrinsics [PR122270]
Andrew Pinski [Wed, 15 Oct 2025 16:59:25 +0000 (09:59 -0700)] 
riscv: Fix gimple folding of the vset* intrinsics [PR122270]

The problem here is that when the backend folds the vset intrinsics,
it tries to keep the lhs of the new statement to be the same as the old statement
due to the check in gsi_replace. The problem is with a MEM_REF vset::fold was
unsharing the new lhs here and using the original lhs in the other new statement.
This meant the check in gsi_replace would fail.
This fixes that oversight by switching around which statement gets the unshared
version.

Note the comment in vset::fold was already correct just not matching the code:
    /* Replace the call with two statements: a copy of the full tuple
       to the call result, followed by an update of the individual vector.

       The fold routines expect the replacement statement to have the
       same lhs as the original call, so return the copy statement
       rather than the field update.  */

Changes since v1:
* v2: Fix testcase.

PR target/122270

gcc/ChangeLog:

* config/riscv/riscv-vector-builtins-bases.cc (vset::fold): Use the
unshare_expr for the statement that will be added seperately rather
the one which will be used for the replacement.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/pr122270-1.c: New test.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
11 days agoinstall.texi: Update COBOL requirements.
James K. Lowden [Sun, 26 Oct 2025 20:50:00 +0000 (16:50 -0400)] 
install.texi: Update COBOL requirements.

gcc/ChangeLog:

* doc/install.texi: Add libxml2 dependency for COBOL
library. Clarify 128-bit numeric dependency.

11 days agopoly-int: Fix struct vs class confusion
Gerald Pfeifer [Sun, 26 Oct 2025 17:01:02 +0000 (18:01 +0100)] 
poly-int: Fix struct vs class confusion

We currently issue a good deal of warnings of the following kind:

  In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/coretypes.h:500:
  .../GCC-HEAD/gcc/poly-int.h:378:1: warning: 'poly_int' defined as a
  struct template here but previously declared as a class template; this
  is valid, but may result in linker errors under the Microsoft C++ ABI
  [-Wmismatched-tags]
    378 | struct poly_int
        | ^
  .../GCC-HEAD/gcc/poly-int.h:32:38: note: did you mean struct here?
     32 | template<unsigned int N, typename T> class poly_int;
        |                                      ^~~~~
        |                                      struct

A `grep "'poly_int' defined as a struct template" | cut -d: -f1 | uniq -c`
shows 749 issue for a typical bootstrap.

Addressing this brings down the bootstrap log by 8.5% - from 80454 lines
down to 73613.

gcc:
* poly-int.h: Change struct poly_int to class poly_int.

11 days agox86-64: Use `movsxd` to perform SI-to-DI extension in Intel syntax
LIU Hao [Sat, 25 Oct 2025 09:19:34 +0000 (17:19 +0800)] 
x86-64: Use `movsxd` to perform SI-to-DI extension in Intel syntax

Although there's no possibility of ambiguity, Intel manual says the mnemonic
for DWORD-to-QWORD sign-extension operation should be MOVSXD. Some assemblers
(GNU AS, NASM) also overload MOVSX, but some others don't accept MOVSX (LLVM,
MASM, YASM in NASM mode) and require MOVSXD.

This mnemonic was introduced in r0-34259-g123bf9e3f4056d in 2001, and has not
been updated ever since.

gcc/ChangeLog:

PR target/119079
* config/i386/i386.md: Use `movsxd` to perform SI-to-DI extension in Intel
syntax.

Signed-off-by: LIU Hao <lh_mouse@126.com>
11 days ago[PATCH v2] RISC-V: Fix moving data from V_REGS to GR_REGS by scalar move.
Kuan-Lin Chen [Sun, 26 Oct 2025 15:09:03 +0000 (09:09 -0600)] 
[PATCH v2] RISC-V: Fix moving data from V_REGS to GR_REGS by scalar move.

When the ELEN is 32 in rv64, it can move a V2SI vector register into a DI GPR.
But the extract result in low-part must be zero-extended.

The following gimples are from pr111391-2.c:
_25 = (char) d.1_23;
_17 = {_25, _25, _25, _25, _25, _25, _25, _25};
a_26 = VIEW_CONVERT_EXPR<long int>(_17);

The final assembly:
vsetivli        zero,2,e32,m1,ta,ma
vslidedown.vi   v2,v4,1
vmv.x.s s1,v4 -> s1 must be zero-extended to prevent the bit 31 of v4[0] is 1
vmv.x.s a4,v2
slli    a5,a4,32
or      s1,a5,s1

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_legitimize_move): Append extend.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr111391-2.c: Add expected asm.

12 days ago[PATCH] middle-end: Fix typos in comments
Osama Abdelkader [Sun, 26 Oct 2025 14:38:06 +0000 (08:38 -0600)] 
[PATCH] middle-end: Fix typos in comments

This patch fixes spelling errors in comments:
- "accomodate" -> "accommodate" in wide-int.h and value-range-storage.h
- "the the" -> "the" in tree-vectorizer.h

gcc/ChangeLog:

* wide-int.h: Fix typo "accomodate" to "accommodate" in comment.
* value-range-storage.h: Likewise.
* tree-vectorizer.h (dr_set_safe_speculative_read_required):
Fix duplicate "the the" to "the" in comment.

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
12 days agoAda: Fix internal error on pragma Machine_Attribute with string constant
Eric Botcazou [Sun, 26 Oct 2025 09:21:31 +0000 (10:21 +0100)] 
Ada: Fix internal error on pragma Machine_Attribute with string constant

This was reported a long time ago and is a fairly pathological case,
so the fix is purposely ad hoc: when the attribute name of a pragma
Machine_Attribute is not a string literal, its processing needs to
be delayed for the back-end.

gcc/ada/
PR ada/13370
* sem_prag.adb (Analyze_Pragma) <Pragma_Machine_Attribute>: Set the
Has_Delayed_Freeze flag if the argument is not a literal.

gcc/testsuite/
* gnat.dg/machine_attr3.ads, gnat.dg/machine_attr3.adb: New test.

12 days agoCobol: Suppress recipe echoing in Makefile
Eric Botcazou [Sun, 26 Oct 2025 09:03:10 +0000 (10:03 +0100)] 
Cobol: Suppress recipe echoing in Makefile

gcc/cobol/
* Make-lang.in ($(srcdir)/cobol/token_names.h): Silence recipe.

12 days agoFortran: Fix generic user operators in PDTs [PR122290]
Paul Thomas [Sun, 26 Oct 2025 07:49:09 +0000 (07:49 +0000)] 
Fortran: Fix generic user operators in PDTs [PR122290]

2025-10-26  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/122290
* decl.cc (variable_decl): Matching component initializer
expressions in PDT templates should be done with gfc_match_expr
to avoid reduction too early. If the expression type is unknown
copy the component typespec.
(gfc_get_pdt_instance): Change comment from a TODO to an
explanation. Insert parameter values in initializers. For
components that are not marked with PDT attributes, do the
full reduction for init expressions.
* primary.cc (gfc_match_actual_arglist): Convert PDT kind exprs
using the component initializer.
* resolve.cc (resolve_typebound_intrinsic_op): Preempt
gfc_check_new_interface for pdt_types as well as entities used
in submodules.
* simplify.cc (get_kind): Remove PDT kind conversion.

gcc/testsuite/
PR fortran/122290
* gfortran.dg/pdt_60.f03: New test.

12 days agolibgccjit: Fix bootstrap fail from format specifiers.
Rainer Orth [Sat, 25 Oct 2025 19:15:41 +0000 (20:15 +0100)] 
libgccjit: Fix bootstrap fail from format specifiers.

The changes in r16-4527-gc11d9eaa8ac9ee caused format mismatches
in jit-recording.cc because Darwin’s uint64_t == long long unsigned int
(and the format specifiers were %ld and %li).

gcc/jit/ChangeLog:

* jit-recording.cc (recording::array_type::make_debug_string,
recording::array_type::write_reproducer): Use PRIu64 format
specifier for uint64_t.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
12 days ago[aarch64] [testsuite] tolerate alternate insn selection [PR121599]
Alexandre Oliva [Sun, 26 Oct 2025 01:45:22 +0000 (22:45 -0300)] 
[aarch64] [testsuite] tolerate alternate insn selection [PR121599]

On gcc-14, instead of 'movi\td[0-9]*,#0', we select
'mov\tz[0-9]*\.b,#0', and the testcase fails.
As in pfalse* tests, tolerate the difference.

for  gcc/testsuite/ChangeLog

PR target/121599
* gcc.target/aarch64/sve2/pr121599.c: Tolerate alterate insn
selection.

12 days agoDaily bump.
GCC Administrator [Sun, 26 Oct 2025 00:17:33 +0000 (00:17 +0000)] 
Daily bump.

12 days agodoc: fix __attribute__((nocf_check)) documentation
Sam James [Sat, 25 Oct 2025 22:03:41 +0000 (23:03 +0100)] 
doc: fix __attribute__((nocf_check)) documentation

Fix two syntax errors (missing '(' and ')' and misplaced '{').

gcc/ChangeLog:

* doc/extend.texi (nocf_check): Fix syntax errors in example.

12 days agolibgcobol: fix compat w/ >=libxml2-2.12
Sam James [Sat, 25 Oct 2025 21:02:43 +0000 (22:02 +0100)] 
libgcobol: fix compat w/ >=libxml2-2.12

libgcobol/ChangeLog:
PR cobol/122398

* xmlparse.cc (__gg__xml_parse): Make 'msg' const.

13 days agoFortran: IS_CONTIGUOUS and pointers to non-contiguous targets [PR114023]
Harald Anlauf [Fri, 24 Oct 2025 19:33:08 +0000 (21:33 +0200)] 
Fortran: IS_CONTIGUOUS and pointers to non-contiguous targets [PR114023]

PR fortran/114023

gcc/fortran/ChangeLog:

* trans-expr.cc (gfc_trans_pointer_assignment): Always set dtype
when remapping a pointer.  For unlimited polymorphic LHS use
elem_len from RHS.
* trans-intrinsic.cc (gfc_conv_is_contiguous_expr): Extend inline
generated code for IS_CONTIGUOUS for pointer arguments to detect
when span differs from the element size.

gcc/testsuite/ChangeLog:

* gfortran.dg/is_contiguous_5.f90: New test.

13 days agoReplace VSB_DIR by sysroot refs in VxWorks LIBGCC2_INCLUDES
Olivier Hainque [Fri, 17 Oct 2025 17:53:02 +0000 (17:53 +0000)] 
Replace VSB_DIR by sysroot refs in VxWorks LIBGCC2_INCLUDES

This matches what VXWORKS_ADDITIONAL_CPP_SPEC does, allowing libgcc to
build without VSB_DIR defined in the environment as soon as the configure
switches featured a proper --with-build-sysroot was provided.

Tested with a successful build for --target=powerpc-wrs-vxworks7r2
using mainline sources.

2025-10-23  Olivier Hainque  <hainque@adacore.com>

libgcc/
* config/t-vxworks (LIBGCC2_INCLUDES): Replace $(VSB_DIR)
by sysroot references.

13 days agoLoongArch: Implement vector reduction from 256-bit to 128-bit
Jiahao Xu [Thu, 23 Oct 2025 06:29:06 +0000 (14:29 +0800)] 
LoongArch: Implement vector reduction from 256-bit to 128-bit

gcc/ChangeLog:

* config/loongarch/lasx.md (vec_extract<mode><lasxhalf>): New define_expand.
(vec_extract_lo_<mode>): New define_insn_and_split.
(vec_extract_hi_<mode>): New define_insn.
* config/loongarch/loongarch-protos.h (loongarch_check_vect_par_cnst_half)
New function prototype.
* config/loongarch/loongarch.cc (loongarch_split_reduction):
Implement TARGET_VECTORIZE_SPLIT_REDUCTION.
(loongarch_check_vect_par_cnst_half): New function.
* config/loongarch/predicates.md
(vect_par_cnst_low_half): New predicate.
(vect_par_cnst_high_half): New predicate.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/lasx-reduc-1.c: New test.

13 days agoDaily bump.
GCC Administrator [Sat, 25 Oct 2025 00:18:16 +0000 (00:18 +0000)] 
Daily bump.

13 days agoAdd test case for PR 110405
Andrew MacLeod [Fri, 24 Oct 2025 21:32:32 +0000 (17:32 -0400)] 
Add test case for PR 110405

PR was fixed bu one of the other patches.

* gcc.dg/pr110405.c: New.

13 days agoRefine COND_EXPR ranges better.
Andrew MacLeod [Fri, 24 Oct 2025 19:09:51 +0000 (15:09 -0400)] 
Refine COND_EXPR ranges better.

Recognize COND_EXPRs where there is only one ssa_name used in the
condition as well as one of the fields in the COND_EXPR.  ie:

  cond = ssa_name < 20
  result = cond ? ssa_name : 20

Adjust the range of ssa_name to reflect the conditional value of ssa_name
relative to whether its in the TRUE or FALSE part of the COND_EXPR.

PR tree-optimization/114025
gcc/
* gimple-range-fold.cc (fold_using_range::condexpr_adjust): Handle
the same ssa_name in the condition and the COND_EXPR better.

gcc/testsuite/
* g++.dg/pr114025.C: New.

13 days agoPR modula2/122407: Followup to spell check remaining intrinsics
Gaius Mulley [Fri, 24 Oct 2025 20:51:36 +0000 (21:51 +0100)] 
PR modula2/122407: Followup to spell check remaining intrinsics

This followup patch ensures that any unknown symbol spell check
error in the instrinsics uses the parameter token rather than the
procedure name token.  In turn this allows the filter module to
detect and remove multiple unknowns at the same token.
The patch also adds spell checking to the instrinsic parameters.

gcc/m2/ChangeLog:

PR modula2/122407
* gm2-compiler/FilterError.def (Copyright): Use correct
licence.
* gm2-compiler/FilterError.mod (Copyright): Ditto.
* gm2-compiler/M2Quads.mod (BuildNewProcedure): Rewrite.
(BuildIncProcedure): Ditto.
(BuildDecProcedure): Ditto.
(BuildInclProcedure): Ditto.
(BuildExclProcedure): Ditto.
(BuildAbsFunction): Ditto.
(BuildCapFunction): Ditto.
(BuildChrFunction): Ditto.
(BuildOrdFunction): Ditto.
(BuildIntFunction): Ditto.
(BuildMinFunction): Ditto.
(BuildMaxFunction): Ditto.
(BuildTruncFunction): Ditto.
(BuildTBitSizeFunction): Ditto.
(BuildTSizeFunction): Ditto.
(BuildSizeFunction): Ditto.

gcc/testsuite/ChangeLog:

PR modula2/122407
* gm2.dg/spell/iso/fail/badspellabs.mod: New test.
* gm2.dg/spell/iso/fail/badspelladr.mod: New test.
* gm2.dg/spell/iso/fail/badspellcap.mod: New test.
* gm2.dg/spell/iso/fail/badspellchr.mod: New test.
* gm2.dg/spell/iso/fail/badspellchr2.mod: New test.
* gm2.dg/spell/iso/fail/badspelldec.mod: New test.
* gm2.dg/spell/iso/fail/badspellexcl.mod: New test.
* gm2.dg/spell/iso/fail/badspellinc.mod: New test.
* gm2.dg/spell/iso/fail/badspellincl.mod: New test.
* gm2.dg/spell/iso/fail/badspellnew.mod: New test.
* gm2.dg/spell/iso/fail/badspellsize.mod: New test.
* gm2.dg/spell/iso/fail/dg-spell-iso-fail.exp: New test.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
13 days agoaarch64/testsuite: fix auto-init-padding-[24].c testcases [PR122402]
Andrew Pinski [Fri, 24 Oct 2025 20:43:24 +0000 (13:43 -0700)] 
aarch64/testsuite: fix auto-init-padding-[24].c testcases [PR122402]

After r16-3956-gf613fdc6920c83, these 2 testcases start to fail as
now SRA will fully scalarize the structs and only provide with the piece
that was used. But the testcase is testing about the padding so turning
off SRA is correct in this case.

Pushed as obvious after testing the testcases now pass.

PR target/122402
gcc/testsuite/ChangeLog:

* gcc.target/aarch64/auto-init-padding-2.c: Turn off SRA.
* gcc.target/aarch64/auto-init-padding-4.c: Likewise.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
13 days agolibstdc++: Fix <mdspan> export in std module
Eric Pimentel Aguiar [Fri, 24 Oct 2025 13:41:04 +0000 (09:41 -0400)] 
libstdc++: Fix <mdspan> export in std module

When exporting declarations in a namespace with using declarations, the
name must be fully qualified. Recently introduced std::full_extent{,_t},
std:strided_slice, and std::submdspan_mapping_result broke module std
and module std.compat.

libstdc++-v3/ChangeLog:

* src/c++23/std.cc.in (std::strided_slice, std::full_extent_t)
(std::full_extent, std::submdspan_mapping_result): Add std
qualification.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
13 days agoAda: Small cleanup in Makefile
Eric Botcazou [Fri, 24 Oct 2025 17:51:12 +0000 (19:51 +0200)] 
Ada: Small cleanup in Makefile

gcc/ada/
PR ada/80033
* gcc-interface/Makefile.in (force): Restore.

13 days agoFortran: fix TRANSFER of subarray component references [PR122386]
Harald Anlauf [Thu, 23 Oct 2025 19:21:04 +0000 (21:21 +0200)] 
Fortran: fix TRANSFER of subarray component references [PR122386]

Commit r16-518 introduced a change that fixed inquiry references of complex
arrays as argument to the TRANSFER intrinsic by forcing a temporary.  The
solution taken however turned out not to be generalizable to component
references of nested derived-type arrays.  A better way is the revert that
patch and force the generation of a temporary when the SOURCE expression is
a not simply-contiguous array.

PR fortran/122386

gcc/fortran/ChangeLog:

* dependency.cc (gfc_ref_needs_temporary_p): Revert r16-518.
* trans-intrinsic.cc (gfc_conv_intrinsic_transfer): Force temporary
for SOURCE not being a simply-contiguous array.

gcc/testsuite/ChangeLog:

* gfortran.dg/transfer_array_subref_2.f90: New test.

13 days agoAda: Small cleanup in Makefile
Nicolas Boulenguez [Fri, 24 Oct 2025 16:51:11 +0000 (18:51 +0200)] 
Ada: Small cleanup in Makefile

gcc/ada/
PR ada/80033
* gcc-interface/Makefile.in (deftarg.o): Delete.
(init-vxsim.o): Likewise.
(force): Likewise.