]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
4 days agoada: Document inline assembler limitations in GNAT LLVM
Sebastian Poeplau [Fri, 17 Apr 2026 10:46:28 +0000 (12:46 +0200)] 
ada: Document inline assembler limitations in GNAT LLVM

gcc/ada/ChangeLog:

* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Mention
inline assembler limitations.
* gnat_ugn.texi: Regenerate.

4 days agoada: Simplify interfacing with gmtime wrapper
Piotr Trojanek [Mon, 13 Apr 2026 22:14:54 +0000 (00:14 +0200)] 
ada: Simplify interfacing with gmtime wrapper

Interface from Ada to C for calling gmtime was over-complicated. Now we just
rely on the Ada RM and what it guarantees when interfacing for parameters of
elementary types depending on their IN/OUT mode.

gcc/ada/ChangeLog:

* adaint.c, adaint.h (__gnat_to_gm_time): Adapt C side, while keeping
the explicit conversion to time_t, if this ever needs to be debugged.
* libgnat/s-os_lib.adb (To_GM_Time): Adapt Ada side.

4 days agoada: Simplify interfacing with localtime wrappers
Piotr Trojanek [Wed, 8 Apr 2026 10:29:37 +0000 (12:29 +0200)] 
ada: Simplify interfacing with localtime wrappers

Interface from Ada to C for calling localtime was over-complicated, including
access types, aliased variables and suppressed CodePeer messages. None of this
is necessary if we just rely on the Ada RM and what it guarantees when
interfacing for parameters of elementary types depending on their IN/OUT mode.

gcc/ada/ChangeLog:

* libgnat/a-calend.adb (localtime_tzoff): Simplify interface.
* sysdep.c (__gnat_localtime_tzoff): Remove duplicated specs; pass
"in" parameters via copy and "out" parameters via pointers.

4 days agoada: Fix problematic call to function returning task in anonymous context
Eric Botcazou [Fri, 10 Apr 2026 10:44:47 +0000 (12:44 +0200)] 
ada: Fix problematic call to function returning task in anonymous context

The problem is that the task returned by the call to the function is never
activated.  This is fixed by creating a transient scope around the call, as
is done for controlled types, after making transient scopes compatible with
task types.

gcc/ada/ChangeLog:

PR ada/42413
* exp_ch4.adb (Process_Transients_In_Expression): Deal with a task
activation chain present in the statement list.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context): Also
establish a transient scope if the result type has tasks.
* exp_ch7.adb (Make_Transient_Block): Deal with Has_Master_Entity
and Has_Activation_Chain_Entity set on the transient scope.
* exp_ch9.ads (Make_Task_Activation_Call): New declaration from...
* exp_ch9.adb (Make_Task_Activation_Call): ...here.
(Build_Activation_Chain_Entity): Deal with transient scopes.
(Build_Master_Entity): Likewise.
(Find_Enclosing_Context): Likewise.
* sem_elab.adb (Activation_Processor.Process_Activation): Deal with
N_Expression_With_Actions nodes.
* sem_util.adb (Current_Entity_In_Scope): Prevent transient scopes
from being transparent for _Chain and _Master entities.

4 days agoada: Small tweaks in task activation support code
Eric Botcazou [Fri, 10 Apr 2026 10:35:21 +0000 (12:35 +0200)] 
ada: Small tweaks in task activation support code

This streamlines Build_Activation_Chain_Entity, factors out common code in
Exp_Ch9, and changes the category of the Is_Task_Allocation_Block flag.

No functional changes.

gcc/ada/ChangeLog:

PR ada/42413
* exp_aggr.adb (Build_Record_Aggr_Code): Minor tweak.
* exp_ch9.adb (Make_Task_Activation_Call): New helper function.
(Build_Activation_Chain_Entity): Streamline.
(Build_Master_Entity): Rename local variable.
(Build_Task_Activation_Call): Call Make_Task_Activation_Call.
(Build_Task_Allocate_Block): Likewise.  Set Is_Task_Allocation_Block
separately after having created the block.
* gen_il-gen-gen_nodes.adb (N_Block_Statement): Change the category
of Is_Task_Allocation_Block flag from syntactic to semantic.

4 days agoada: Replace Activation_Chain_Entity field by Has_Activation_Chain_Entity flag
Eric Botcazou [Wed, 8 Apr 2026 21:51:18 +0000 (23:51 +0200)] 
ada: Replace Activation_Chain_Entity field by Has_Activation_Chain_Entity flag

The former lives on selected nodes while the latter lives on scope entities.
This is more consistent because 1) activation chains are entities attached
to a scope and 2) master entities already use the Has_Master_Entity flag.

The ultimate goal is to make transient scopes compatible with task types.

No functional changes.

gcc/ada/ChangeLog:

PR ada/42413
* gen_il-fields.ads (Opt_Field_Enum): Remove Activation_Chain_Entity
and add Has_Activation_Chain_Entity.
* gen_il-gen-gen_entities.adb (Entity_Kind): Add new semantic flag
Has_Activation_Chain_Entity.
* gen_il-gen-gen_nodes.adb (N_Subprogram_Body): Remove
Activation_Chain_Entity field.
(N_Task_Body): Likewise.
(N_Package_Declaration): Likewise.
(N_Block_Statement): Likewise.
(N_Extended_Return_Statement): Likewise.
(N_Entry_Body): Likewise.
* einfo.ads (Has_Activation_Chain_Entity): Document new flag.
* sinfo.ads (Activation_Chain_Entity): Delete documentation.
* exp_ch9.adb (Build_Activation_Chain_Entity): Replace uses of
Activation_Chain_Entity by Has_Activation_Chain_Entity.
(Build_Task_Activation_Call): Retrieve the activation chain entity
by means of new helper function Activation_Chain_Entity.
(Build_Task_Allocate_Block): Set Has_Activation_Chain_Entity in
lieu of Activation_Chain_Entity.
(Expand_N_Task_Body): Likewise.
(Find_Enclosing_Context): Fix handling of N_Entry_Body.
* sem_ch7.adb (May_Need_Implicit_Body): Replace test on
Activation_Chain_Entity by Has_Activation_Chain_Entity.

4 days agoada: Avoid referencing ignored ghost nodes in finalizer
Viljar Indus [Tue, 14 Apr 2026 13:38:13 +0000 (16:38 +0300)] 
ada: Avoid referencing ignored ghost nodes in finalizer

gcc/ada/ChangeLog:

* exp_ch7.adb (Processing_Actions): Avoid processing
ignored ghost declarations.

4 days agoada: Fix missing dispatching for default implementation of S'Class'{Read,Write}
Eric Botcazou [Tue, 14 Apr 2026 18:52:00 +0000 (20:52 +0200)] 
ada: Fix missing dispatching for default implementation of S'Class'{Read,Write}

Note that 'Output and 'Put_Image are also affected since they share a common
implementation with the others.

gcc/ada/ChangeLog:

PR ada/18205
* exp_attr.adb (Rewrite_Attribute_Proc_Call): Skip the conversion to
the formal type only if the actual is of a class-wide type. Generate
a dispatching call when both the prefix is a class-wide type and the
subprogram is a dispatching operation.
(Expand_N_Attribute_Reference) <Input>: Use U_Type consistently and
remove an useless invocation of Root_Type.
<Put_Image>: Minor comment tweak.
<Read>: Likewise.
<Write>: Likewise.

4 days agoada: Minor cleanup in macro test
Marc Poulhiès [Fri, 27 Mar 2026 15:55:07 +0000 (16:55 +0100)] 
ada: Minor cleanup in macro test

The majority of the macros checked have already been checked a few line
above. Only difference is __CYGWIN32__, so check for its absence instead
of the presence of the others.

gcc/ada/ChangeLog:

* sysdep.c (getc_immediate_common): Cleanup macro test.

4 days agoada: Tweak predicate name and documentation comment
Ronan Desplanques [Mon, 13 Apr 2026 15:59:04 +0000 (17:59 +0200)] 
ada: Tweak predicate name and documentation comment

The old name was wrong because a type is not a subcomponent of itself.
In other words, "is a subcomponent of" is not a reflexive relation. Also,
the old comment implied that the Ekind of the return value was
E_Component; it's actually a type.

gcc/ada/ChangeLog:

* sem_util.ads (Partially_Visible_Subcomponent): Rename into ...
(Partially_Visible_Part): ...this. Improve documentation.
* sem_util.adb: Likewise.
* sem_ch3.adb (Analyze_Component_Declaration,
Array_Type_Declaration): Adapt to renaming.
* sem_ch7.adb (Install_Composite_Operations): Likewise.

4 days agoada: Remove doc for long gone field
Ronan Desplanques [Fri, 10 Apr 2026 13:57:41 +0000 (15:57 +0200)] 
ada: Remove doc for long gone field

The field Contains_Ignored_Ghost_Code was removed by the transition to
Gen_IL but its einfo.ads documentation stayed around. This patch removes
this documentation.

gcc/ada/ChangeLog:

* einfo.ads (Contains_Ignored_Ghost_Code): Remove documentation.

4 days agoada: Refactor Has_Assertion_Level_Argument for consistency
Mathias Aparicio [Thu, 9 Apr 2026 12:32:51 +0000 (14:32 +0200)] 
ada: Refactor Has_Assertion_Level_Argument for consistency

First branches of `Has_Assertion_Level_Argument` test an equality and if
met return False.

This patch apply this logic for the two other if that returned False
after the if.

gcc/ada/ChangeLog:

* sem_util.adb (Has_Assertion_Level_Argument): Invert the final
check in aspect branch and the check in pragma branch to use
early returns for consistency.

4 days agoada: Fix indentation checks with "finally"
Ronan Desplanques [Thu, 9 Apr 2026 12:51:33 +0000 (14:51 +0200)] 
ada: Fix indentation checks with "finally"

When the parser encounters the word "finally", it first considers it an
identifier and then looks ahead and possibly recategorizes it as a
keyword. The expected level of indentation depends on the final verdict,
but indentation checks were performed right away. This patch fixes the
issue by delaying the checks appropriately.

gcc/ada/ChangeLog:

* par.adb, par-util.adb (Check_Bad_Layout_At): New procedure.
* par-ch3.adb (P_Declarative_Item): Use new procedure.
* par-ch5.adb (P_Sequence_Of_Statements): Likewise.

4 days agoada: Fix crash in Has_Assertion_Level_Argument
Viljar Indus [Thu, 9 Apr 2026 08:22:05 +0000 (11:22 +0300)] 
ada: Fix crash in Has_Assertion_Level_Argument

This method would crash if the association was not a
N_Component_Association. As it could be something else like an
N_Iterated_Component_Association that does not have the choices
attribute.

gcc/ada/ChangeLog:

* sem_util.adb (Has_Assertion_Level_Argument): Check for
the correct type of association.

4 days agoada: Support qualified error names from Standard
Viljar Indus [Wed, 8 Apr 2026 11:32:40 +0000 (14:32 +0300)] 
ada: Support qualified error names from Standard

Typically nodes from Standard were not printed without the
fully qualified prefix names even when Error_Msg_Qual_Level was set.
However in some cases it makes sense to emphasize that the variable
is coming from Standard.

Add a new variable called Error_Msg_Qual_For_Standard to enable
qualified names for entities coming from Standard.

gcc/ada/ChangeLog:

* err_vars.ads (Error_Msg_Qual_For_Standard): New Variable.
* errout.ads (Error_Msg_Qual_For_Standard): Likewise.
* errout.adb (Set_Qualification): Print all qualified names
when Error_Msg_Qual_For_Standard is set.
* sem_util.adb (Normalize_Actuals): Improve error message.

4 days agoada: Improve error message for incorrect call arguments
Viljar Indus [Wed, 8 Apr 2026 10:02:06 +0000 (13:02 +0300)] 
ada: Improve error message for incorrect call arguments

Enumeration literals are considered as zero argument functions.
This is not obvious for most users and can create confusing error
messages when an enumeration literal is referred to as a call. For
example if there are indices applied to it.

Instead create a dedicated error message for this scenario.

gcc/ada/ChangeLog:

* sem_util.adb (Normalize_Actuals): Improve error message.

4 days agoada: Fix memory leak in __gnat_setenv
Mathias Aparicio [Thu, 26 Mar 2026 15:54:09 +0000 (16:54 +0100)] 
ada: Fix memory leak in __gnat_setenv

Before this patch, the code executed on Linux used `putenv`, which
requires a memory allocation. However, the memory was explicitly freed
only for Windows (`__MINGW32__`) and older VxWorks targets. Because
Linux fell into the allocation block but not the free block, there
was a memory leak.

To fix the leak, `__gnat_setenv` now calls `setenv` for Linux, doing
the same thing we were already doing for macOS.

Note that putting Linux in the Windows block is not a solution because,
on Linux, `putenv` uses the pointer directly and does not copy the
string. Therefore, if the memory were freed right away, there would be
a use-after-free.

To be careful, we do not use `setenv` everywhere else (except for old
VxWorks targets and Windows), because there might be problems with other
configurations if we do so.

gcc/ada/ChangeLog:

* env.c (__gnat_setenv): Add __linux__ preprocessor macro
directive to the setenv block.

4 days agoada: Fix SPARK RM 6.9(23) check for limited private types
Viljar Indus [Wed, 1 Apr 2026 07:36:46 +0000 (10:36 +0300)] 
ada: Fix SPARK RM 6.9(23) check for limited private types

The Check_Ghost_Equality_Op predicate was checking the type directly
instead of its underlying type, so a limited private type whose full
view is a non-limited record was incorrectly bypassing the check.
Additionally, the check was never deferred to Process_Full_View, so
equality operators declared in the visible part of a package were
not re-checked once the full view became available.

gcc/ada/ChangeLog:

* ghost.adb (Check_Ghost_Equality_Op): Use Underlying_Type to
look through the private view before checking Is_Record_Type and
Is_Limited_Record.
* sem_ch3.adb (Process_Full_View): After completing the full view,
re-check any primitive equality operators on the private type
against SPARK RM 6.9(23) via Check_Ghost_Equality_Op.

4 days agoada: Further streamlining work
Eric Botcazou [Tue, 7 Apr 2026 16:29:17 +0000 (18:29 +0200)] 
ada: Further streamlining work

This streamlines Build_Task_Allocate_Block from Exp_Ch9 by making it return
the block statement only, changes Add_Task_Actuals_To_Build_In_Place_Call to
deal with the master and activation chain actuals more consistently, as well
as flattens an inner block in Make_Build_In_Place_Call_In_Allocator.

No functional changes.

gcc/ada/ChangeLog:

* exp_ch9.ads (Build_Task_Allocate_Block): Change return type.
* exp_ch9.adb (Build_Task_Allocate_Block): Likewise.  Build an
internal block entity instead of declaring an implicit label.
* exp_aggr.adb (Convert_Aggr_In_Allocator): Adjust to above change.
* exp_ch4.adb (Expand_N_Allocator): Likewise.
* exp_ch6.adb (Add_Task_Actuals_To_Build_In_Place_Call): Add default
value for Master_Actual parameter, change name of 4th parameter to
Chain_Actual and deal with them consistently.
(Make_Build_In_Place_Call_In_Allocator): Flatten block statement.
Adjust call to Add_Task_Actuals_To_Build_In_Place_Call.
(Make_Build_In_Place_Call_In_Anonymous_Context): Likewise.
(Make_Build_In_Place_Call_In_Assignment): Likewise.
(Make_Build_In_Place_Call_In_Object_Declaration): Likewise.
* exp_ch7.adb (Build_Cleanup_Statements): Minor tweak.

4 days agoada: Add note about Sem_Aux being in binder closure
Ronan Desplanques [Tue, 7 Apr 2026 12:03:00 +0000 (14:03 +0200)] 
ada: Add note about Sem_Aux being in binder closure

I recently realized that Sem_Aux is in the binder's closure, unlike
Sem_Util. This patch makes it explicit in a comment since it can be
useful when choosing where to put a helper subprogram.

gcc/ada/ChangeLog:

* sem_aux.ads: Add note.

4 days agoada: Improve layout of record types from Sem
Eric Botcazou [Fri, 3 Apr 2026 09:40:27 +0000 (11:40 +0200)] 
ada: Improve layout of record types from Sem

Compiling the unit with -gnatRh shows unused bits in the record types from
the Sem unit.  This change saves two 32-bit words for Scope_Stack_Entry.

gcc/ada/ChangeLog:

* sem.ads (Suppress_Stack_Entry): Move down Suppress component.
(Scope_Stack_Entry): Reorder components to eliminate holes.

4 days agoada: Update gnat-llvm debugging documentation
Tom Tromey [Fri, 3 Apr 2026 18:31:04 +0000 (12:31 -0600)] 
ada: Update gnat-llvm debugging documentation

With the latest patches to LLVM and gnat-llvm, I believe that types
are represented correctly.  This patch updates the documentation
accordingly.

gcc/ada/ChangeLog:

* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(GNATLLVM): Update debugging documentation.
* gnat_ugn.texi: Regenerate.

4 days agoada: Cleanup aspect specifications (Ins_Node)
Bob Duff [Sun, 5 Apr 2026 12:42:21 +0000 (08:42 -0400)] 
ada: Cleanup aspect specifications (Ins_Node)

Get rid of the Ins_Node parameters and variable. We still treat
pragma Annotate specially, but at least the special case is more
localized now. (It is quadratic in the number of pragmas Annotate,
which is acceptable.) We should eventually remove this special case.

In the compilation unit case, insert at the end of Pragmas_After,
rather than the beginning. This is not necessary, but seems more
uniform with the non-compilation-unit cases. Remove ??? marks.

gcc/ada/ChangeLog:

* sem_ch13.adb
(Insert_Aitem): Remove Ins_Node formal parameter.
(Analyze_One_Aspect): Likewise.
(Analyze_Aspect_Specifications): Remove Ins_Node local variable.
(Insert_After_Place): New function containing the
special case for Annotate.

4 days agoada: Add missing documentation for attribute Ref
Piotr Trojanek [Wed, 1 Apr 2026 15:16:23 +0000 (17:16 +0200)] 
ada: Add missing documentation for attribute Ref

Attribute Ref was implemented for compatibility with other compilers, but never
documented.

gcc/ada/ChangeLog:

* doc/gnat_rm/implementation_defined_attributes.rst (Attribute_Ref):
New section based on comment in sem_attr.ads.
* gnat_rm.texi: Regenerate.

4 days agoada: Restore alphabetical ordering in Sem_Util
Ronan Desplanques [Wed, 1 Apr 2026 08:15:46 +0000 (10:15 +0200)] 
ada: Restore alphabetical ordering in Sem_Util

gcc/ada/ChangeLog:

* sem_util.adb, sem_util.ads (Partially_Visible_Subcomponent): Move
to right spot.

4 days agoada: Small consistency fixes
Eric Botcazou [Wed, 1 Apr 2026 15:47:56 +0000 (17:47 +0200)] 
ada: Small consistency fixes

Build_Activation_Chain_Entity and Build_Master_Entity from Exp_Ch9 are very
similar but the former takes a Node while the latter takes an Entity.  This
aligns the latter with the former.  No functional changes.

gcc/ada/ChangeLog:

* exp_aggr.adb (Build_Array_Aggr_Code): Adjust actual parameter in
the call to Build_Master_Entity.
* exp_ch3.adb (Expand_N_Full_Type_Declaration): Likewise.
(Expand_N_Object_Declaration): Likewise.
(Expand_Previous_Access_Type): Likewise.
* exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context):
Likewise.
(Make_Build_In_Place_Iface_Call_In_Allocator): Likewise.
(Make_Build_In_Place_Iface_Call_In_Anonymous_Context): Likewise.
* sem_ch3.adb (Access_Definition): Likewise.
(Access_Type_Declaration): Likewise.
* exp_ch9.ads (Build_Activation_Chain_Entity): Tweak description.
(Build_Master_Entity): Change parameter and tweak description.
* exp_ch9.adb (Build_Master_Entity): Change parameter and adjust.

4 days agoada: Implement AI12-0331 Binding Interpretation
Eric Botcazou [Tue, 31 Mar 2026 09:48:11 +0000 (11:48 +0200)] 
ada: Implement AI12-0331 Binding Interpretation

The Binding Interpretation defines the order of the four steps that occur
during the finalization of subpools. The order was previously unspecified
but the AI mentions that there was no real leeway, i.e. that there was a
unique possible order; however it turns out that GNAT implements another
order, which therefore needs to be changed.

Moreover GNAT's implementation is unnecessarily convoluted: 1) it uses a
circular doubly-linked list with a fake head to implement the subpools,
but the subpools have a pointer to the owner of the list, so a simple
doubly-linked list is sufficient and 2) it allocates special nodes on
the heap to chain the subpools onto the list, which is a bit awkward.

gcc/ada/ChangeLog:

PR ada/124143
* libgnat/s-spsufi.ads (Finalize_And_Deallocate): Adjust comment.
* libgnat/s-spsufi.adb: Remove clause for Ada.Unchecked_Deallocation
(Finalize_And_Deallocate): Adjust and implement AI12-0331.
* libgnat/s-stposu.ads (Allocate_From_Subpool): Remove ??? comment.
(Deallocate_Subpool): Likewise.
(SP_Node): Delete.
(SP_Node_Ptr): Likewise.
(Root_Storage_Pool_With_Subpools): Adjust type of Subpools component
(Root_Subpool): Remove Node, add Prev and Next components.
(Detach): Adjust signature.
(Initialize): Delete.
(Initialize_Pool): Likewise.
* libgnat/s-stposu.adb (Allocate_Any_Controlled): Adjust.
(Attach): Reimplement.
(Detach): Likewise.
(Finalize_Pool): Loop over a simple doubly linked list.
(Initialize): Delete.
(Initialize_Pool): Likewise.
(Print_Pool): Adjust.
(Print_Subpool): Likewise.
(Set_Pool_Of_Subpool): Remove obsolete code.

4 days agoada: Rename Has_Private_Component function
Ronan Desplanques [Tue, 31 Mar 2026 08:50:44 +0000 (10:50 +0200)] 
ada: Rename Has_Private_Component function

The expression "private component" is best reserved for components of
protected objects' private sections. This renames a function from
"Has_Private_Component" to a more explicit name because that function is
not about the protected object component case.

gcc/ada/ChangeLog:

* sem_util.ads (Has_Private_Component): Rename into...
(Is_Incompletely_Defined): ...this.
* sem_util.adb (Has_Private_Component): Rename into...
(Is_Incompletely_Defined): ...this.
(Check_Fully_Declared): Adapt to above renaming.
* exp_ch3.adb (Freeze_Type): Likewise.
* freeze.adb (Check_And_Freeze_Type): Likewise.
* sem_aggr.adb (Array_Aggr_Subtype): Likewise.
* sem_ch12.adb (Instantiate_Type): Likewise.
* sem_ch13.adb (Rep_Item_Too_Early): Likewise.
* sem_ch3.adb (Access_Definition, Analyze_Full_Type_Declaration,
Analyze_Subtype_Declaration, Build_Derived_Access_Type,
Copy_And_Build, Complete_Private_Subtype, Constrain_Access,
Constrain_Array, Build_Constrained_Access_Type, Constrain_Concurrent,
Constrain_Corresponding_Record, Copy_Array_Subtype_Attributes,
Derived_Type_Declaration): Likewise.
* sem_ch6.adb (Create_Extra_Formals): Likewise.
* sem_res.adb (Make_Call_Into_Operator): Likewise.

4 days agoada: Restrict Is_Limited_Composite field to (sub)types
Ronan Desplanques [Tue, 31 Mar 2026 10:27:57 +0000 (12:27 +0200)] 
ada: Restrict Is_Limited_Composite field to (sub)types

Is_Limited_Composite was set on all entities during the migration to
Gen_IL, but it's only used on types and subtypes. This moves the field
to the appropriate entity kind.

gcc/ada/ChangeLog:

* gen_il-gen-gen_entities.adb (Gen_Entities): Move
Is_Limited_Composite.
* einfo.ads (Is_Limited_Composite): Update documentation.

4 days agoada: Avoid giving multiple errors on ghost argument
Viljar Indus [Tue, 31 Mar 2026 09:04:37 +0000 (12:04 +0300)] 
ada: Avoid giving multiple errors on ghost argument

Avoid marking multiple errors on the same line if the ghost
expression is both non-static and also would evaluate to False.

gcc/ada/ChangeLog:

* sem_prag.adb (Analyze_Abstract_State): make error checks
exclusive.

4 days agoada: Rename Private_Component function
Ronan Desplanques [Mon, 30 Mar 2026 10:36:02 +0000 (12:36 +0200)] 
ada: Rename Private_Component function

The expression "private component" is best reserved for components of
protected objects' private sections. This renames a function from
"Private_Component" to a more explicit name because that function is not
about the protected object component case.

gcc/ada/ChangeLog:

* sem_util.ads, sem_util.adb (Private_Component): Rename into...
(Partially_Visible_Subcomponent): ...this.
* sem_ch3.adb (Analyze_Component_Declaration, Array_Type_Declaration):
Adapt to above renaming.
* sem_ch7.adb (Install_Composite_Operations): Likewise.

4 days agoSwitch g++ to default Solaris 11.4 compilation environment
Rainer Orth [Tue, 2 Jun 2026 08:31:47 +0000 (10:31 +0200)] 
Switch g++ to default Solaris 11.4 compilation environment

g++ has predefined _XOPEN_SOURCE=600 since

[fixincludes, v3] Enable full ISO C99 support for C++ on Solaris 10+
http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01308.html

While Solaris 10 introduced XPG6/POSIX.1-2001 support, the default
compilation environment remained XPG3 until Solaris 11.3.  However,
libstdc++ uses many XPG6 interfaces, so g++ needed to explicitly enable
that.

Only Solaris 11.4 implemented XPG7/POSIX.1-2008 support, at the same
time changing the default to XPG7.

Therefore, g++ can remove the explicit enablement of XPG6, using the
11.4 default just like gcc has done all the time.

__EXTENSIONS__ needs to remain, however: a considerable part of
libstdc++ depends on that.

Bootstrapped on i386-pc-solaris2.11, amd64-pc-solaris2.11,
sparc-sun-solaris2.11, and sparcv9-sun-solaris2.11.  There were no
changed to any config.h file.

2026-05-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* config/sol2.h (TARGET_OS_CPP_BUILTINS): Don't define
_XOPEN_SOURCE=600 for C++.

4 days agolibsanitizer: Fix sanitizer_platform_limits_solaris.cpp compilation
Rainer Orth [Tue, 2 Jun 2026 08:26:16 +0000 (10:26 +0200)] 
libsanitizer: Fix sanitizer_platform_limits_solaris.cpp  compilation

As described in

[sanitizer_common] Fix sanitizer_platform_limits_solaris.cpp compilation (#198158)
https://github.com/llvm/llvm-project/pull/198158

sanitizer_platform_limits_solaris.cpp fails to compile when g++ is
switched to the default Solaris 11.4 compilation environment, XPG7 +
extensions.

This patch, cherry-picked from upstream, fixes this.

Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11.

2026-05-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libsanitizer:
* sanitizer_common/sanitizer_platform_limits_solaris.cpp:
Cherry-pick llvm-project revision
0e92b557a78eddc7493ade4cfc0a3b6b93ee61cf.

4 days agotree-optimization/120702 - avoid folding loads to STRING_CSTs
Richard Biener [Wed, 29 Apr 2026 07:19:43 +0000 (09:19 +0200)] 
tree-optimization/120702 - avoid folding loads to STRING_CSTs

The following avoids (large) string duplication which can happen
when folding aggregate reads to STRING_CSTs.  There's unlikely
to be followup optimization opportunities.

PR tree-optimization/120702
* gimple-fold.cc (maybe_fold_reference): Only fold
register type reads.

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

4 days agolibstdc++: Support limited escaped formatting for non-Unicode literals.
Tomasz KamiÅ„ski [Fri, 15 May 2026 09:07:03 +0000 (11:07 +0200)] 
libstdc++: Support limited escaped formatting for non-Unicode literals.

This restores limited support debug (escaped) output for string when literal
encoding is non-Unicode, by allowing strings that contains only printable
ASCII characters and standard defined escapes (expanded with nul (\0)).
This covers common use-cases, while still preserving flexibility to provide
proper handling for escaping of encoding-specific characters.

libstdc++-v3/ChangeLog:

* include/std/format (__format::__write_escaped_ascii): Mark as
_GLIBCXX_CONSTEXPR_FORMAT and at compile time, reject strings
containing characters other than printable ASCII and standard
escapes.
* testsuite/std/format/debug.cc: Test basic_escapes and \0
at compile-time.
* testsuite/std/format/debug_nonunicode_neg.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agolibstdc++: implement constexpr std::format
Ivan Lazaric [Fri, 15 May 2026 09:06:54 +0000 (11:06 +0200)] 
libstdc++: implement constexpr std::format

This patch implements constexpr formatting from P3391R2,
and introduces the constexpr_format feature-test macro.
Since pre-cxx11 cow_string is not constexpr-enabled,
only exposing the feature-test macro under cxx11 ABI.

Add `__format::__toupper_numeric` function that work in constexpr.
It is not fully general, but `<format>` doesn't need all uppercasing.

The `__write_escaped_ascii` is not marked constexpr, to enable
futhure improvement for non-unicode literal encodings (for example
using `iconv`).

Update `__check_dynamic_spec` to check if `__args` is run, to
accomodate for dynamic_format or vformat invoked at compile time.

Mark `basic_format_string` consteval constructor noexcept,
since exceptions are now constexpr, and the standard mandates
failure to parse to be non-catchable ill-formed.
https://eel.is/c++draft/format#fmt.string-3
> Remarks: A call to this function is not a core constant expression
> ([expr.const]) unless there exist args of types Args such that
> str is a format string for args.

Update some formatting tests to test constexpr as well,
and introduce a dedicated smoke test for constexpr formatting.

libstdc++-v3/ChangeLog:

* include/bits/version.def (constexpr_exceptions): Move before
format.
(constexpr_format): Define.
* include/bits/version.h: Regenerate.
* include/std/format (_GLIBCXX_CONSTEXPR_FORMAT): Define and
apply to all of functions except __write_escaped_ascii and
__formatter_fp members.
(_GLIBCXX_CONSTEXPR_FORMAT_ERROR): Replace with
_GLIBCXX_CONSTEXPR_FORMAT.
(basic_format_string::basic_format_string(const _Tp&)):
Mark as noexcept.
(__format::__toupper_numeric): Define.
(__formatter_int::format): Use __format::__toupper_numeric
and replace __builtin_memcpy with ranges::copy.
(__formatter_fp::format): Use __format::__toupper_numeric.
(__formatter_ptr::format): Avoid reinterpret_cast for
null-pointer value to support std::nullptr_t formatting.
(__format::__do_vformat_to): Replace __builtin_memcpy with
ranges::copy.
(basic_format_parse_context::__check_dynamic_spec):
Skip checks if __args pointer is null.
* testsuite/std/format/arguments/args_neg.cc: Diagnostics change.
* testsuite/std/format/constexpr.cc: New test.
* testsuite/std/format/debug.cc: Test at compile-time in C++26
and update iteration limit for paddding tests.
* testsuite/std/format/tuple.cc: Likewise.
* testsuite/std/format/functions/format.cc: Test at compile-time
in C++26.
* testsuite/std/format/dynamic_format.cc: Likewise.
* testsuite/std/format/functions/format_to.cc: Likewise.
* testsuite/std/format/functions/size.cc: Likewise.
* testsuite/std/format/ranges/format_kind.cc: Likewise.
* testsuite/std/format/ranges/formatter.cc: Likewise.
* testsuite/std/format/ranges/sequence.cc: Likewise.
* testsuite/std/format/string.cc: Likewise.
* testsuite/std/time/format/data_not_present_neg.cc: Diagnostics
change.

Co-authored-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Ivan Lazaric <ivan.lazaric1@gmail.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agowide-int: Fix up wi::bitreverse_large [PR125517]
Jakub Jelinek [Tue, 2 Jun 2026 06:52:44 +0000 (08:52 +0200)] 
wide-int: Fix up wi::bitreverse_large [PR125517]

The following testcase shows wi::bitreverse_large is buggy.  In particular,
it uses the len argument (i.e. number of limbs the xval wide_int has)
to decide how much to clear, but it should be using BLOCKS_NEEDED
(precision) for that and for canonize argument similarly to wi::bswap_large,
because it behaves similarly to that.  If xval is say len 1 but precision
512, we want to clear all 512 bits in the result limbs and the loop then
sets the most significant one in there and canonize with len (512 + 63) /
64, not initialize just the least significant limb, set various bits in the
uninitialized ones and then only care about the least significant 64 bits
anyway.

2026-06-02  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/125517
* wide-int.cc (wi::bitreverse_large): Rename LEN argument to XLEN and
use it as safe_uhwi argument.  Add LEN automatic variable set to
BLOCKS_NEEDED (precision).  Replace loop clearing val with memset.
Remove I automatic variable.

* gcc.dg/builtin-bitreverse-9.c: New test.

Reviewed-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
4 days agolibstdc++: mark integer std::to_(w)string constexpr
Ivan Lazaric [Fri, 15 May 2026 09:06:46 +0000 (11:06 +0200)] 
libstdc++: mark integer std::to_(w)string constexpr

In C++26 paper P3391, "constexpr formatting", has been adopted,
part of which marks std::to_string & std::to_wstring for integers
as constexpr. The __cpp_lib_constexpr_string FTM value is updated
per resolution of LWG4531, "Should there be a feature-test macro
update for constexpr std::to_(w)string?".

Since pre-cxx11 copy-on-write string is not constexpr-enabled,
restricting this constexpr-ification to cxx11 ABI strings.

libstdc++-v3/ChangeLog:

* include/bits/version.def (constexpr_string): Bump to 202511.
* include/bits/version.h: Regenerate.
* include/bits/basic_string.h (std::to_string, std::to_wstring)
[__glibcxx_constexpr_string >= 202511L]: Mark as constexpr.
* testsuite/21_strings/basic_string/numeric_conversions/char/to_string_constexpr.cc:
New test.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/to_wstring_constexpr.cc:
New test.
* testsuite/21_strings/basic_string/cons/char/constexpr.cc: Update
__cpp_lib_constexpr_string check.
* testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc: Likewise.
* testsuite/21_strings/basic_string/version.cc: Add check for value of
__cpp_lib_constexpr_string in C++26.

Co-authored-by: Tomasz Kamiński <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Nathan Myers <ncm@cantrip.org>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
4 days agoFix up gfortran.dg/gomp/allocate-*.f90
Jakub Jelinek [Tue, 2 Jun 2026 06:36:32 +0000 (08:36 +0200)] 
Fix up gfortran.dg/gomp/allocate-*.f90

The r17-1009 change (in particular gfc_match_omp_variable_list hunk
of it) fixed spelling of one diagnostic message, but has not adjusted
corresponding testsuite, so these tests now fail.

Fixed thusly.

2026-06-02  Jakub Jelinek  <jakub@redhat.com>

* gfortran.dg/gomp/allocate-6.f90: Adjust dg-error wording after
recent spelling fixes.
* gfortran.dg/gomp/allocate-7.f90: Likewise.
* gfortran.dg/gomp/allocate-14.f90: Likewise.
* gcc.target/sparc/struct-ret-check-1.c: Fix comment spelling,
specificed -> specified.

4 days agoFortran: Fix submodule access to private symbols in parent module [PR88632,104630]
Paul Thomas [Mon, 1 Jun 2026 11:40:53 +0000 (12:40 +0100)] 
Fortran: Fix submodule access to private symbols in parent module [PR88632,104630]

PRs 88632 and 104630 both suffered link a problem, where a private procedure
in a parent module was not visible in a descendent submodule if they were
compiled separately.

The fix is to not filter out private symbols when writing the .smod file.
Submodules are descendants of their ancestor module and access private symbols
in the module's contains section via host association (F2018 14.2.2).

The testcase here is that of PR104630. However, it is functionally identical
to that of PR88632.

2026-06-02  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/88632
PR fortran/104630
* module.cc (write_symtree): Do not filter out private symbols
when writing a submodule interface file (.smod).  Submodules are
descendants of their ancestor module and access private symbols
in the module's contains section via host association per
Fortran 2018 section 14.2.2.

gcc/testsuite/
PR fortran/88632
PR fortran/104630
* gfortran.dg/submodule_35.f90: New test.
* gfortran.dg/submodule_35_aux.f90: Submodule and program for
for the new test.

Assisted by: Claude Sonnet 4.6

4 days agoRISC-V: Fix typos in comments and a misspelled variable
Jin Ma [Sat, 30 May 2026 13:32:07 +0000 (21:32 +0800)] 
RISC-V: Fix typos in comments and a misspelled variable

Fix comment typos, grammatical errors and GNU two-space sentence
spacing across the RISC-V backend.  Also rename the misspelled local
variable additioanl_bytes in riscv_zcmp_valid_stack_adj_bytes_p to
additional_bytes.

The change is limited to comments and a local variable name, so this
is a non-functional change.  No test case is added as no behaviour
changes.

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc: Fix typos in comments.
* config/riscv/andes-25-series.md: Likewise.
* config/riscv/autovec-opt.md: Likewise.
* config/riscv/autovec.md: Likewise.
* config/riscv/bitmanip.md: Likewise.
* config/riscv/constraints.md: Likewise.
* config/riscv/gen-riscv-ext-opt.cc: Likewise.
* config/riscv/gen-riscv-mcpu-texi.cc: Likewise.
* config/riscv/generic-vector-ooo.md: Likewise.
* config/riscv/multilib-generator: Likewise.
* config/riscv/riscv-avlprop.cc: Likewise.
* config/riscv/riscv-ext.def: Likewise.
* config/riscv/riscv-ext.opt: Likewise.
* config/riscv/riscv-modes.def: Likewise.
* config/riscv/riscv-opt-popretz.cc: Likewise.
* config/riscv/riscv-profiles.def: Likewise.
* config/riscv/riscv-protos.h: Likewise.
* config/riscv/riscv-selftests.cc: Likewise.
* config/riscv/riscv-sr.cc: Likewise.
* config/riscv/riscv-string.cc: Likewise.
* config/riscv/riscv-subset.h: Likewise.
* config/riscv/riscv-target-attr.cc: Likewise.
* config/riscv/riscv-v.cc: Likewise.
* config/riscv/riscv-vect-permconst.cc: Likewise.
* config/riscv/riscv-vector-builtins-bases.cc: Likewise.
* config/riscv/riscv-vector-builtins-functions.def: Likewise.
* config/riscv/riscv-vector-builtins-shapes.cc: Likewise.
* config/riscv/riscv-vector-builtins-types.def: Likewise.
* config/riscv/riscv-vector-builtins.cc: Likewise.
* config/riscv/riscv-vector-builtins.def: Likewise.
* config/riscv/riscv-vector-builtins.h: Likewise.
* config/riscv/riscv-vector-costs.cc: Likewise.
* config/riscv/riscv-vector-costs.h: Likewise.
* config/riscv/riscv-vsetvl.cc: Likewise.
* config/riscv/riscv-vsetvl.def: Likewise.
* config/riscv/riscv-zicfilp.cc: Likewise.
* config/riscv/riscv.cc: Likewise.
(riscv_zcmp_valid_stack_adj_bytes_p): Rename misspelled
variable additioanl_bytes to additional_bytes.
* config/riscv/riscv.h: Likewise.
* config/riscv/riscv.md: Likewise.
* config/riscv/sifive-vector-builtins-functions.def: Likewise.
* config/riscv/sifive_vector.h: Likewise.
* config/riscv/spacemit-x60.md: Likewise.
* config/riscv/thead.cc: Likewise.
* config/riscv/tt-ascalon-d8.md: Likewise.
* config/riscv/vector-crypto.md: Likewise.
* config/riscv/vector-iterators.md: Likewise.
* config/riscv/vector.md: Likewise.
* config/riscv/zicond.md: Likewise.
* doc/riscv-mcpu.texi: Regenerate.

4 days agoRISC-V: Clean up redundant code and fix GNU coding style issues
Jin Ma [Sat, 30 May 2026 14:46:05 +0000 (22:46 +0800)] 
RISC-V: Clean up redundant code and fix GNU coding style issues

Tidy up a few non-functional issues in the RISC-V backend.
genrvv-type-indexer.cc includes <assert.h> but uses no assert, and
riscv-v.cc includes "targhooks.h" twice; remove both.  In addition,
riscv_output_move and riscv_save_libcall_count call abort () where
gcc_unreachable () is the preferred idiom for unreachable points.

The remaining changes fix GNU coding style: add the missing space before
the open parenthesis of function calls and casts, fix brace placement,
remove a stray double semicolon and re-wrap a few over-long lines.

All of the above is redundant code, an idiom change or formatting, so
this is a cleanup with no functional change.  No test case is added as
no behaviour changes.

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc: Fix formatting.
* config/riscv/gen-riscv-mcpu-texi.cc: Likewise.
* config/riscv/gen-riscv-mtune-texi.cc: Likewise.
* config/riscv/genrvv-type-indexer.cc: Remove unused <assert.h>
include.
* config/riscv/riscv-string.cc: Fix formatting.
* config/riscv/riscv-target-attr.cc: Likewise.
* config/riscv/riscv-v.cc: Remove duplicate "targhooks.h" include.
Fix formatting.
* config/riscv/riscv-v.h: Fix formatting.
* config/riscv/riscv-vsetvl.cc: Likewise.
* config/riscv/riscv.cc (riscv_pass_by_reference): Remove stray
double semicolon.  Fix formatting elsewhere.
(riscv_output_move): Use gcc_unreachable () instead of abort ().
(riscv_save_libcall_count): Use gcc_unreachable () instead of
abort ().
* config/riscv/riscv.h: Fix formatting.
* config/riscv/thead.cc: Likewise.

4 days agolibbacktrace: support compressed block with no sequences
Ian Lance Taylor [Tue, 2 Jun 2026 04:34:27 +0000 (21:34 -0700)] 
libbacktrace: support compressed block with no sequences

* elf.c (elf_zstd_decompress_frame): Support a compressed block
with no sequences, only literals.

4 days agocobol: Improve execution speed of FUNCTION TRIM.
Robert Dubner [Tue, 2 Jun 2026 02:50:28 +0000 (22:50 -0400)] 
cobol: Improve execution speed of FUNCTION TRIM.

By breaking out specific code for FUNCTION TRIM when the string is
single-byte-coded ASCII or EBCDIC, and by creating a matching
__gg__trim_1 routine using std::find_if(), the function operates about
fifteen to 25 times faster than it did.

gcc/cobol/ChangeLog:

* compare.cc (cobol_compare_relop): Rename the cobol_compare_relop
function.
(cobol_compare): Likewise.
* compare.h (cobol_compare_relop): Likewise.
(cobol_compare): Likewise.
* genapi.cc (parser_display): Refine the use of SYSPUNCH_e for
inserting debugging comments into the assembly language.
(parser_relop): Use "cobol_compare".
(handle_gg_trim): Break out SBC TRIM logic.
(parser_intrinsic_call_2): Likewise.
(parser_bsearch_when): Use "cobol_compare"
* genutil.cc (refer_is_super_clean): FldLiteralN is always "super
clean".
(is_pure_integer): Make binary_from_FldNumericBin5 "static bool".
(binary_from_FldLiteralN): New function.
(get_binary_value): Use the new function.

libgcobol/ChangeLog:

* intrinsic.cc (__gg__trim): Eliminate useless comment.
(__gg__trim_1): New function.

4 days agoc/c++: Declare stack protection guard in file scope
H.J. Lu [Wed, 6 May 2026 12:58:47 +0000 (20:58 +0800)] 
c/c++: Declare stack protection guard in file scope

When stack protection guard is declared in c_common_nodes_and_builtins,
it is put in the externals scope outside file scope which triggers
-Wnested-externs warning in C:

cc1: warning: nested extern declaration of '__stack_chk_guard' [-Wnested-externs]

Declare stack protection guard in file scope instead.

gcc/c-family/

PR c/121911
* c-common.cc (c_common_nodes_and_builtins): Don't declare stack
protection guard here.

gcc/c/

PR c/121911
* c-decl.cc (push_file_scope): Add stack protection guard to
visible_builtins.

gcc/cp/

PR c/121911
* decl.cc (cxx_init_decl_processing ): Declare stack protection
guard after calling c_common_nodes_and_builtins.

gcc/testsuite/

PR c/121911
* gcc.dg/Wnested-externs-1.c: Add -mstack-protector-guard=global
for x86.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
5 days agoi386: Add avx512_avoid_vec_perm tune for c86-4g-m7
Tianle Shi [Tue, 2 Jun 2026 01:05:02 +0000 (01:05 +0000)] 
i386: Add avx512_avoid_vec_perm tune for c86-4g-m7

This implements the AVX512 avoid-vec-perm cost model for c86-4g-m7
following the existing AVX256 support r15-4234-g9eaecce3d8c1d9.

Extend the vectorizer cost model to treat 512-bit cross-lane vec_perm
as unprofitable when this tune is enabled, since c86-4g-m7 implements
AVX512 as two 256-bit halves and cross-lane reorder is slower than
staying in AVX256.

Factor out the cross-lane permutation classification into a helper so
the AVX256 and AVX512 cost handling can share the same logic without
duplicating it.

gcc/ChangeLog:

* config/i386/i386.cc (ix86_vector_costs): Add
m_num_avx512_vec_perm.
(ix86_vector_costs::ix86_vector_costs): Initialize it.
(ix86_count_cross_lane_perm_p): New helper to classify
cross-lane vec_perm for AVX256 and AVX512 handling.
(ix86_vector_costs::add_stmt_cost): Use the helper for
vec_perm accounting, record 256-bit and 512-bit counts,
and print detected width as avx%u.
(ix86_vector_costs::finish_cost): Reject AVX512 costs
when TARGET_AVX512_AVOID_VEC_PERM is set and 512-bit
cross-lane vec_perm is present.
* config/i386/i386.h (TARGET_AVX512_AVOID_VEC_PERM):
New macro.
* config/i386/x86-tune.def (X86_TUNE_AVX512_AVOID_VEC_PERM):
New tune for c86-4g-m7.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx512_avoid_vec_perm-1.c: New test.
* gcc.target/i386/avx512_avoid_vec_perm-2.c: New test.
* gcc.target/i386/avx512_avoid_vec_perm-3.c: New test.

Signed-off-by: Tianle Shi <shitianle@hygon.cn>
5 days agoFinish cleanup/removing -Wstrict-overflow= support [PR125558]
Andrew Pinski [Mon, 1 Jun 2026 20:39:36 +0000 (13:39 -0700)] 
Finish cleanup/removing -Wstrict-overflow= support [PR125558]

This finishes removing the support for -Wstrict-overflow that seemly was
missed before. It also marks the option as being ignored and fixes
the -Wstrict-overflow= case where it was rejecting -Wstrict-overflow=1 now.

Pushed as obvious after bootstrap/test on x86_64-linux-gnu.

PR middle-end/125558

gcc/ChangeLog:

* common.opt (Wstrict-overflow): Mark as Ignore.
(Wstrict-overflow=): Fix up and mark as igore.
* gcc-diagnostic-spec.cc (nowarn_spec_t::nowarn_spec_t):
Remove OPT_Wstrict_overflow.
* opts.cc (common_handle_option): Likewise.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
5 days agoc++: Improve -fdump-lang-class output
Peter Damianov [Tue, 28 Apr 2026 16:54:50 +0000 (17:54 +0100)] 
c++: Improve -fdump-lang-class output

When I was researching to write my blogpost about vtables:
https://peter0x44.github.io/posts/vtables-itanium-abi/

I noticed a few improvements I could make to -fdump-lang-class's output

-fdump-lang-class prepended "0x" to HOST_WIDE_INT_PRINT_HEX outputs, but the
macro already includes that prefix, producing "0x0x..." in dumps.

Some vtable entries hold signed values e.g. vcall offsets, vbase offsets,
 offset-to-top.  When expr_as_string prints those INTEGER_CSTs,
negative offsets appear as large (unsigned) values.  Print integer vtable
entries as signed values, and keep expr_as_string for all other entries.

gcc/cp/ChangeLog:

* class.cc (dump_vtable_entry): New function.
(dump_array): Use it.
(dump_class_hierarchy_r): Drop redundant literal 0x from
HOST_WIDE_INT_PRINT_HEX formatting.
(dump_vtable): Likewise.

Signed-off-by: Peter Damianov <peter0x44@disroot.org>
5 days agoDaily bump.
GCC Administrator [Tue, 2 Jun 2026 00:16:46 +0000 (00:16 +0000)] 
Daily bump.

5 days agofortran: submodule cannot access internal subprograms of ancestor module via host...
Jerry DeLisle [Mon, 25 May 2026 16:29:33 +0000 (09:29 -0700)] 
fortran: submodule cannot access internal subprograms of ancestor module via host association

A submodule could not access internal subprograms of its ancestor module
via host association.  References to such procedures were rejected with
"has no IMPLICIT type".  Fortran 2018 Â§14.6.1.3 requires submodules to
host-associate the specification part and the module subprogram part of
their ancestor module; Intel Fortran and NAG Fortran accept this usage.

Root cause: when parse_module processes a submodule, gfc_current_ns->parent
is left NULL, so the host-association walk cannot reach the ancestor
module's namespace and its internal procedures.

Fix (parse.cc, parse_module): after use_modules() and gfc_traverse_ns(),
strip the child suffix from the submodule's dotted name (e.g. "m.s" -> "m"),
search gfc_global_ns_list for the matching ancestor namespace, and set
gfc_current_ns->parent to it.

Fix (parse.cc, clean_up_modules): before calling gfc_done_2(), reset
gfc_current_ns->parent to NULL to prevent gfc_symbol_done_2 from walking up
to and double-freeing the ancestor module namespace during teardown.

The new parent link also required boundary guards in three places that walk
up the namespace chain:

Fix (class.cc, gfc_find_derived_vtab): the vtab lookup walks up ns->parent
to find the top-level namespace.  Stop at module/submodule boundaries
(FL_MODULE flavor) so that vtables for types defined in a submodule are not
incorrectly placed in the ancestor module namespace.

Fix (openmp.cc, gfc_omp_requires_add_clause, gfc_match_omp_requires,
gfc_match_omp_atomic): three OpenMP helpers walk ns->parent to find the
enclosing program unit.  Each acquired the same boundary guard so the
submodule is treated as its own program unit for OMP REQUIRES purposes.

PR fortran/125527

Assisted by: Claude Sonnet 4.6

gcc/fortran/ChangeLog:

PR fortran/125527
* class.cc (gfc_find_derived_vtab): Stop the top-level namespace
walk at module/submodule boundaries to avoid escaping a submodule
into its ancestor module namespace.
* openmp.cc (gfc_omp_requires_add_clause): Likewise; treat the
submodule as its own program unit for OMP REQUIRES.
(gfc_match_omp_requires): Likewise; allow OMP REQUIRES in a submodule
spec part even when gfc_current_ns->parent is now non-NULL.
(gfc_match_omp_atomic): Likewise.
* parse.cc (parse_module): After processing USE statements and
host-association traversal, link the submodule namespace to its
ancestor module namespace so internal subprograms are visible via
host association (Fortran 2018, 14.6.1.3).
(clean_up_modules): Reset gfc_current_ns->parent before gfc_done_2
to prevent double-free of the ancestor module namespace.

gcc/testsuite/ChangeLog:

PR fortran/125527
* gfortran.dg/submodule_host_assoc_1.f90: New test.
* gfortran.dg/submodule_host_assoc_1_aux.f90: New test.

5 days agoc++: Fix spurious -Wduplicated-branches for new (nothrow) T[n] [PR125422]
Joe Natter [Thu, 21 May 2026 18:20:16 +0000 (20:20 +0200)] 
c++: Fix spurious -Wduplicated-branches for new (nothrow) T[n] [PR125422]

When allocating an array of a trivial type with new (nothrow),
build_new_1() may emit a compiler-generated COND_EXPR of the form

  (alloc_node != nullptr) ? rval : alloc_node

For trivial arrays without constructors, destructors, or array cookies,
rval remains equal to data_addr and is therefore equivalent to
alloc_node.  This causes both branches of the generated COND_EXPR to be
identical, triggering -Wduplicated-branches on user code.

Avoid building the null-check COND_EXPR when rval == data_addr.

gcc/cp/ChangeLog:
PR c++/125422
* init.cc (build_new_1): Avoid building a null-check
COND_EXPR when rval == data_addr.

gcc/testsuite/ChangeLog:
PR c++/125422
* g++.dg/warn/Wduplicated-branches10.C: New test.

Signed-off-by: Joe Natter <johannes.natter@outlook.at>
Reviewed-by: Jason Merrill <jason@redhat.com>
5 days agoc: fix false positive for -Wvla-parameter [PR98539]
Martin Uecker [Sat, 30 May 2026 14:30:50 +0000 (16:30 +0200)] 
c: fix false positive for -Wvla-parameter [PR98539]

In case of VLAs that are multi-dimensional arrays with unspecified sizes,
the test in the warning code did not work correctly.  Fix this by
explicitely checking that there are specified or unspecified size
expressions to determine the presence of a VLA.

PR c/98539

gcc/c-family/ChangeLog:
* c-warn.cc (warn_parm_array_mismatch): Check number of size
expressions.

gcc/testsuite/ChangeLog:
* gcc.dg/pr98539.c: New test.

5 days agotestsuite: xfail shrink-wrapping-vector-1.C until PR125400 is fixed
Andrew Pinski [Mon, 1 Jun 2026 19:50:50 +0000 (12:50 -0700)] 
testsuite: xfail shrink-wrapping-vector-1.C until PR125400 is fixed

After r17-603-gacfdad706d8acc, shrink-wrapping-vector-1.C started to
fail because of a missed optimization. So let's mark it as xfail
for the C++ versions where it fails (that is c++17 and down).

Pushed as obvious after testing to see if the testcase xfails correctly.

gcc/testsuite/ChangeLog:

* g++.dg/opt/shrink-wrapping-vector-1.C: xfail for C++17down.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
5 days agofortran: wrong generic resolution when actual argument is a procedure pointer
Jerry DeLisle [Tue, 26 May 2026 19:00:33 +0000 (12:00 -0700)] 
fortran: wrong generic resolution when actual argument is a procedure pointer

When a generic interface has two specific procedures -- one with a
procedure-pointer dummy and one with a data-object (e.g. REAL) dummy --
gfortran incorrectly resolved calls where the actual argument was a
procedure pointer to the data-object specific, resulting in the pointer
address being interpreted as a numeric value (wrong code).

The root cause was a missing check in gfc_compare_actual_formal: the
two existing checks guard the case where the formal is a proc_pointer
or FL_PROCEDURE but the actual is not; however the reverse direction
(actual is a proc_pointer but formal is a plain data object) was not
checked.  F23:15.5.2.5, para 2 forbids this pairing.

Assisted by: Claude Sonnet 4.6

gcc/fortran/ChangeLog:

PR fortran/125481
* interface.cc (gfc_compare_actual_formal): Add missing check that
rejects a procedure-pointer actual argument corresponding to a
data-object dummy argument (F23:15.5.2.5, para 2).  Restrict to
EXPR_VARIABLE to avoid false positives on calls through procedure
pointer components.

gcc/testsuite/ChangeLog:

PR fortran/125481
* gfortran.dg/generic_37.f90: New test.
* gfortran.dg/generic_38.f90: New test.

5 days agoPR target/122827: aarch64: Treat SVE modes as full-Z for callee-save accounting
Kyrylo Tkachov [Wed, 27 May 2026 20:47:48 +0000 (13:47 -0700)] 
PR target/122827: aarch64: Treat SVE modes as full-Z for callee-save accounting

PR122827 is a miscompile of 526.blender_r in SPEC2017 with
-Ofast -flto=auto -mcpu=neoverse-v2 -msve-vector-bits=128 --param aarch64-autovec-preference=sve-only.
Bisection landed on g:b191e8bdecf (the IRA cost-model rework for PR117477), and the
miscompile disappears with -mearly-ra=none, -fno-caller-saves, or
-fno-early-ra, all of which steer register allocation away from V8-V15.

The bug is in shade_material_loop in shadeinput.c, where a broadcast of
a float scalar to a VNx2SF value is held in V14 across a call:

    mov     z14.s, s15            ; broadcast s15 -> all 4 .s lanes of z14
    ...
    bl      shade_lamp_loop       ; clobbers V14[127:64]
    ...
    fmla    z20.s, p7/m, z14.s, z21.s   ; reads all 4 .s lanes of z14

Under AAPCS64 only the low 64 bits of V8-V15 (D8-D15) are callee-saved.
The prologue dutifully saves d14/d15, but the broadcast and FMA both
touch the full Z register, and the upper half of v14 gets corrupted by
the call -- producing wrong floating-point results.

VNx2SF has GET_MODE_SIZE == 8, so the previous part-clobber check
treated V14 as fully preserved for that mode.  The mode size is
correct for the *data* (two 32-bit lanes), but the underlying SVE
instructions are not packed -- the two .s lanes live at byte offsets
0-3 and 8-11 of the Z register (the .d-strided layout used for partial
SVE modes), so byte 8 onwards is outside the AAPCS64-preserved range.
Any SVE mode in V8-V15 across a call is therefore partially clobbered,
regardless of GET_MODE_SIZE.

The change in g:b191e8bdecf made the cost of allocating a callee-saved
register low enough that IRA started picking V14 for these pseudos,
exposing the latent miscompile.

Two places need fixing:

  * aarch64_hard_regno_call_part_clobbered uses GET_MODE_SIZE to decide
    whether the callee-preserved low 64 bits are enough for the value.
    For SVE modes, compare against BYTES_PER_SVE_VECTOR instead: any
    SVE mode physically uses the full Z register.

  * early-RA classifies allocno groups into FPR_D/FPR_Q/FPR_Z by mode
    bit size, and partial_fpr_clobbers then maps FPR_D to V8QImode for
    the ABI check.  That synthetic V8QImode hides the fact that the
    pseudo is actually an SVE mode, so V8-V15 are not excluded from the
    candidate set.  Classify any SVE mode as FPR_Z so that
    partial_fpr_clobbers uses VNx16QImode and correctly removes V8-V15.

A new test is added in gcc.target/aarch64/sve/pr122827.c
Before the fix the execution test aborts (V14 is allocated to the broadcast
across the call, and the explicit clobber inside the callee corrupts its upper
lanes). after the fix it passes.

Explicitly clobbering V14 with inline assembly in the test may be a bit fragile
as it depends on RA picking V14 for the pre-call broadcast to trigger the bug
but I couldn't find a good way of generalising it without perturbing RA in ways
that made the bug not trigger.

With this patch blender passes again and no regressions on
aarch64-none-linux-gnu bootstrap.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
gcc/ChangeLog:

PR target/122827
* config/aarch64/aarch64.cc (aarch64_hard_regno_call_part_clobbered):
For SVE modes use BYTES_PER_SVE_VECTOR for the per-register size
rather than GET_MODE_SIZE.
* config/aarch64/aarch64-early-ra.cc (early_ra::get_allocno_subgroup):
Classify any SVE mode as FPR_Z.

gcc/testsuite/ChangeLog:

PR target/122827
* gcc.target/aarch64/sve/pr122827.c: New test.

5 days agoc++/modules: Add reflection in module dialect.
yxj-github-437 [Sat, 30 May 2026 08:41:01 +0000 (16:41 +0800)] 
c++/modules: Add reflection in module dialect.

Some ICE will occur when reflection codes compile without
-freflection but the std module built with -freflection.
So the module dialect should include reflection.

gcc/cp/ChangeLog:
* module.cc (module_state_config::get_dialect): Add reflection
dialect.

Reviewed-by: Jason Merrill <jason@redhat.com>
5 days agoc++: > in requires in template argument [PR125317]
Eczbek [Fri, 22 May 2026 16:57:09 +0000 (12:57 -0400)] 
c++: > in requires in template argument [PR125317]

PR c++/125317

gcc/cp/ChangeLog:

* parser.cc (cp_parser_requirement_body): Set
parser->greater_than_is_operator_p.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-requires42.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
5 days agoaarch64: Adjust vectorizer loads+store issue info for Olympus
Kyrylo Tkachov [Mon, 1 Jun 2026 16:00:48 +0000 (09:00 -0700)] 
aarch64: Adjust vectorizer loads+store issue info for Olympus

After some more experimentation and evaluation I'm adjusting the
Olympus issue numbers. This unlocks more vector unrolling that's
beneficial for that core.

Bootstrapped and tested on aarch64-none-linux-gnu.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
* config/aarch64/tuning_models/olympus.h (olympus_scalar_issue_info,
olympus_advsimd_issue_info, olympus_sve_issue_info): Set
loads_stores_per_cycle to 6.

5 days agoaarch64: Adjust alignment tunings for Olympus
Kyrylo Tkachov [Sun, 31 May 2026 09:05:56 +0000 (02:05 -0700)] 
aarch64: Adjust alignment tunings for Olympus

After some more benchmarking and evaluation I'd like to increase the alignments
needed for -mcpu=olympus.  All three of loop_align, function_align and
jump_align are needed to get a good mix of improvements.  I've added skip
amounts to keep the code size bloat down.  There is some, but the performance
benefit on -mcpu=olympus binaries is worth it (cpython from SPEC2026 in
particular benefits consistently).

As an aside, I do think we'll want a more fine-grained description of alignment
in our CPU tuning structs for -O3 binaries.  -O3 may be willing to pay the
extra padding cost for speed-tuned functions and loops and may want to avoid
the skip amount if the CPU is good enough at skipping past them.
But the -O2 settings may still want to use skip amount to avoid excessive
distro binary bloat.

Bootstrapped and tested on aarch64-none-linux-gnu.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
gcc/ChangeLog

* config/aarch64/tuning_models/olympus.h (olympus_tunings):
Adjust loop_align, function_align, jump_align.

5 days agoRegenerate c.opt.urls
Mark Wielaard [Mon, 1 Jun 2026 16:22:20 +0000 (18:22 +0200)] 
Regenerate c.opt.urls

Regenerate opt.urls for deprecation (and removal) of -Wstrict-overflow.

Fixes: b31a43560e88 ("gcc: finalize deprecation of -Wstrict-overflow")
gcc/c-family/ChangeLog:

* c.opt.urls: Regenerate.

5 days agoRe-flow lines made longer than 80 characters by typo fixes
Dhruv Chawla [Wed, 27 May 2026 12:28:38 +0000 (12:28 +0000)] 
Re-flow lines made longer than 80 characters by typo fixes

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/arm/arm-mve-builtins-shapes.cc (struct viddup_def):
Re-flow comment.
(struct vidwdup_def): Likewise.
* config/arm/arm.cc (arm_mve_check_reg_origin_is_num_elems): Likewise.
* config/loongarch/sync.md: Likewise.
* config/microblaze/microblaze.cc (compute_frame_size): Likewise.
* config/rs6000/rs6000-call.cc (rs6000_gimplify_va_arg): Likewise.

5 days agolibstdc++: Fix typos in os/vxworks/os_defines.h
Dhruv Chawla [Thu, 21 May 2026 12:29:54 +0000 (12:29 +0000)] 
libstdc++: Fix typos in os/vxworks/os_defines.h

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
libstdc++-v3/ChangeLog:

* config/os/vxworks/os_defines.h: Fix typos.

5 days agolibitm: Fix typo in config/linux/futex_bits.h
Dhruv Chawla [Thu, 21 May 2026 12:29:05 +0000 (12:29 +0000)] 
libitm: Fix typo in config/linux/futex_bits.h

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
libitm/ChangeLog:

* config/linux/futex_bits.h: Fix typo.

5 days agolibgomp: Fix typos in various files
Dhruv Chawla [Thu, 21 May 2026 12:28:26 +0000 (12:28 +0000)] 
libgomp: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
libgomp/ChangeLog:

* config/gcn/simple-bar.h: Fix typos.
* config/linux/futex.h: Likewise.
* config/nvptx/bar.c (gomp_team_barrier_cancel): Likewise.
* config/nvptx/bar.h (gomp_team_barrier_wake): Likewise.
* config/nvptx/simple-bar.h: Likewise.
* config/posix/sem.c: Likewise.
* config/posix/sem.h: Likewise.
* config/posix/simple-bar.h: Likewise.

5 days agolibatomic: Fix typos in various files
Dhruv Chawla [Thu, 21 May 2026 11:48:48 +0000 (11:48 +0000)] 
libatomic: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
libatomic/ChangeLog:

* config/mingw/lock.c: Fix typos.
* config/posix/lock.c: Likewise.

5 days agogcc/config: Fix typos in various files
Dhruv Chawla [Thu, 21 May 2026 11:48:10 +0000 (11:48 +0000)] 
gcc/config: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/darwin-c.cc (find_subframework_header): Fix typos.
* config/darwin-driver.cc (darwin_find_version_from_kernel): Likewise.
* config/darwin.cc (darwin_label_is_anonymous_local_objc_name): Likewise.
(fprintf): Likewise.
* config/sol2-stubs.cc: Likewise.
* config/sol2.cc (solaris_elf_asm_comdat_section): Likewise.
* config/sol2.h: Likewise.
* config/vx-common.h: Likewise.
* config/vxworks.h (vxworks_asm_out_destructor): Likewise.

5 days agoxtensa: Fix typo in xtensa.cc
Dhruv Chawla [Thu, 21 May 2026 11:46:41 +0000 (11:46 +0000)] 
xtensa: Fix typo in xtensa.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/xtensa/xtensa.cc (xtensa_legitimize_address): Fix typos.

5 days agovms: Fix typos in various files
Dhruv Chawla [Thu, 21 May 2026 11:46:13 +0000 (11:46 +0000)] 
vms: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/vms/vms-c.cc (enum extern_model_kind): Fix typos.
(vms_pragma_message): Likewise.
(vms_c_register_includes): Likewise.
* config/vms/vms.cc (vms_function_section): Likewise.

5 days agovisium: Fix typos in visium.h
Dhruv Chawla [Thu, 21 May 2026 11:45:24 +0000 (11:45 +0000)] 
visium: Fix typos in visium.h

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/visium/visium.h (CASE_VECTOR_PC_RELATIVE): Fix typos.

5 days agovax: Fix typos in various files
Dhruv Chawla [Thu, 21 May 2026 11:44:47 +0000 (11:44 +0000)] 
vax: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/vax/vax.cc (vax_expand_addsub_di_operands): Fix typos.
* config/vax/vax.h (PRINT_OPERAND_ADDRESS): Likewise.

5 days agosparc: Fix typos in various files
Dhruv Chawla [Thu, 21 May 2026 11:44:03 +0000 (11:44 +0000)] 
sparc: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/sparc/freebsd.h: Fix typos.
* config/sparc/sparc.cc (emit_scc_insn): Likewise.
(sparc_emit_membar_for_model): Likewise.

5 days agosh: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 13:01:51 +0000 (13:01 +0000)] 
sh: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/sh/sh-mem.cc (sh_expand_cmpstr): Fix typos.
* config/sh/sh.cc (sh_option_override): Likewise.
(sh_rtx_costs): Likewise.
(fixup_addr_diff_vecs): Likewise.
(sh_expand_epilogue): Likewise.
(sh_legitimize_address_displacement): Likewise.
(sh_can_use_simple_return_p): Likewise.
(sh_find_equiv_gbr_addr): Likewise.
(sh_check_add_incdec_notes): Likewise.
* config/sh/sh.md: Likewise.
* config/sh/sh4-300.md: Likewise.
* config/sh/sh_treg_combine.cc (sh_treg_combine::try_combine_comparisons): Likewise.
(sh_treg_combine::try_eliminate_cstores): Likewise.
* config/sh/sync.md: Likewise.

5 days agorx: Fix typos in rx.cc and rx.md
Dhruv Chawla [Wed, 20 May 2026 12:16:11 +0000 (12:16 +0000)] 
rx: Fix typos in rx.cc and rx.md

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/rx/rx.cc (rx_print_operand): Fix typos.
(rx_expand_epilogue): Likewise.
* config/rx/rx.md: Likewise.

5 days agos390: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 12:14:09 +0000 (12:14 +0000)] 
s390: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/s390/2817.md: Fix typos.
* config/s390/s390.cc (s390_contiguous_bitmask_nowrap_p): Likewise.
(s390_contiguous_bitmask_p): Likewise.
(s390_short_displacement): Likewise.
(s390_expand_cmpmem): Likewise.
(s390_expand_vec_movstr): Likewise.
(s390_expand_cstoreti4): Likewise.
(s390_expand_int_spaceship): Likewise.
(s390_z10_optimize_cmp): Likewise.
(s390_support_vector_misalignment): Likewise.
* config/s390/s390.h (NO_FUNCTION_CSE): Likewise.
* config/s390/s390.md: Likewise.
* config/s390/subst.md: Likewise.
* config/s390/vx-builtins.md: Likewise.

libgcc/ChangeLog:

* config/s390/tpf-unwind.h (s390_fallback_frame_state): Likewise.

5 days agors6000: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 12:11:37 +0000 (12:11 +0000)] 
rs6000: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/rs6000/aix.h: Fix typos.
* config/rs6000/cell.md: Likewise.
* config/rs6000/darwin.h: Likewise.
* config/rs6000/mmintrin.h: Likewise.
* config/rs6000/rs6000-call.cc (rs6000_gimplify_va_arg): Likewise.
* config/rs6000/rs6000-internal.h: Likewise.
* config/rs6000/rs6000-logue.cc (is_altivec_return_reg): Likewise.
(rs6000_output_function_prologue): Likewise.
* config/rs6000/rs6000-p8swap.cc (quad_aligned_store_p): Likewise.
(const_load_sequence_p): Likewise.
(replace_swapped_aligned_store): Likewise.
* config/rs6000/rs6000-passes.def: Likewise.
* config/rs6000/rs6000-string.cc (expand_cmp_vec_sequence): Likewise.
(expand_compare_loop): Likewise.
* config/rs6000/rs6000.cc (rs6000_debug_addr_mask): Likewise.
(rs6000_setup_reg_addr_masks): Likewise.
(darwin_rs6000_override_options): Likewise.
(rs6000_option_override_internal): Likewise.
(rs6000_cost_data::determine_suggested_unroll_factor): Likewise.
(rs6000_cannot_force_const_mem): Likewise.
(rs6000_emit_le_vsx_move): Likewise.
(rs6000_secondary_reload_memory): Likewise.
(rs6000_reverse_condition): Likewise.
(rs6000_expand_float128_convert): Likewise.
(rs6000_adjust_atomic_subword): Likewise.
(rs6000_expand_atomic_op): Likewise.
(rs6000_xcoff_declare_object_name): Likewise.
(output_pcrel_opt_reloc): Likewise.
(rs6000_set_up_by_prologue): Likewise.
(rs6000_split_logical_inner): Likewise.
(rs6000_split_multireg_move): Likewise.
* config/rs6000/rs6000.h: Likewise.
* config/rs6000/rs6000.md: Likewise.
* config/rs6000/sync.md: Likewise.
* config/rs6000/vector.md: Likewise.
* config/rs6000/vsx.md: Likewise.
* config/rs6000/vxworks.h: Likewise.

5 days agorl78: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 12:07:05 +0000 (12:07 +0000)] 
rl78: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/rl78/rl78.cc (rl78_alloc_physical_registers): Fix typos.
(set_origin): Likewise.
(rl78_remove_unused_sets): Likewise.

5 days agopdp11: Fix typo in pdp11.cc
Dhruv Chawla [Wed, 20 May 2026 12:06:21 +0000 (12:06 +0000)] 
pdp11: Fix typo in pdp11.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/pdp11/pdp11.cc (pdp11_insn_cost): Fix typo.

5 days agoriscv: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 12:05:56 +0000 (12:05 +0000)] 
riscv: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_subset_list::add): Fix
typos.
(riscv_subset_list::parse_single_multiletter_ext): Likewise.
(riscv_subset_list::set_loc): Likewise.
(riscv_arch_str): Likewise.
* config/riscv/riscv-avlprop.cc: Likewise.
* config/riscv/riscv-bclr-lowest-set-bit.cc (find_later_ctz): Likewise.
* config/riscv/riscv-ext-andes.def: Likewise.
* config/riscv/riscv-ext.def: Likewise.
* config/riscv/riscv-profiles.def: Likewise.
* config/riscv/riscv-selftests.cc (run_const_vector_selftests): Likewise.
(run_broadcast_selftests): Likewise.
(riscv_run_selftests): Likewise.
* config/riscv/riscv-string.cc (riscv_expand_strcmp): Likewise.
* config/riscv/riscv-v.cc (shuffle_decompress_patterns): Likewise.
(vls_mode_valid_p): Likewise.
* config/riscv/riscv-vect-permconst.cc (vector_permconst::process_bb): Likewise.
* config/riscv/riscv-vector-builtins.cc (riscv_pragma_intrinsic_flags_pollute): Likewise.
* config/riscv/riscv-vsetvl.cc: Likewise.
* config/riscv/riscv-zicfilp.cc: Likewise.
* config/riscv/riscv.cc (riscv_expand_mult_with_const_int): Likewise.
(riscv_rtx_costs): Likewise.
(riscv_address_cost): Likewise.
(riscv_vls_cc_function_abi): Likewise.
(riscv_frm_mode_needed): Likewise.
(dispatch_function_versions): Likewise.
* config/riscv/riscv.h (DWARF_REG_TO_UNWIND_COLUMN): Likewise.
* config/riscv/riscv.md: Likewise.

5 days agopa: Fix typos in pa.cc
Dhruv Chawla [Wed, 20 May 2026 11:59:15 +0000 (11:59 +0000)] 
pa: Fix typos in pa.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/pa/pa.cc (pa_assemble_integer): Fix typos.
(pa_can_change_mode_class): Likewise.

libgcc/ChangeLog:

* config/pa/linux-atomic.c: Fix typos.
* config/pa/sync-libfuncs.c: Likewise.

5 days agoor1k: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:52:49 +0000 (11:52 +0000)] 
or1k: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/or1k/or1k.cc (or1k_strict_argument_naming): Fix typos.
(or1k_print_operand_address): Likewise.
* config/or1k/or1k.md: Likewise.

5 days agonvptx: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:51:21 +0000 (11:51 +0000)] 
nvptx: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/nvptx/nvptx.cc (nvptx_option_override): Fix typos.
(nvptx_assemble_undefined_decl): Likewise.
(nvptx_mem_maybe_shared_p): Likewise.
(nvptx_discover_pars): Likewise.
(verify_neutering_labels): Likewise.
(nvptx_condjump_label): Likewise.
(nvptx_lockfull_update): Likewise.
* config/nvptx/nvptx.md: Likewise.

libgcc/ChangeLog:

* config/nvptx/atomic.c: Fix typos.

5 days agonds32: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:49:03 +0000 (11:49 +0000)] 
nds32: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* common/config/nds32/nds32-common.cc (nds32_except_unwind_info): Fix
typos.
* config/nds32/constants.md: Likewise.
* config/nds32/constraints.md: Likewise.
* config/nds32/nds32-cost.cc (nds32_rtx_costs_speed_prefer): Likewise.
* config/nds32/nds32-dspext.md: Likewise.
* config/nds32/nds32-e8.md: Likewise.
* config/nds32/nds32-fp-as-gp.cc (nds32_fp_as_gp_check_available): Likewise.
* config/nds32/nds32-intrinsic.cc (nds32_expand_priority_builtin): Likewise.
* config/nds32/nds32-isr.cc (nds32_emit_isr_vector_section): Likewise.
(nds32_asm_file_end_for_isr): Likewise.
* config/nds32/nds32-md-auxiliary.cc (output_cond_branch): Likewise.
(nds32_expand_cbranch): Likewise.
(nds32_expand_float_cstore): Likewise.
(nds32_expand_movcc): Likewise.
(nds32_output_stack_pop): Likewise.
(nds32_output_return): Likewise.
(nds32_split_sms): Likewise.
(nds32_legitimize_tls_address): Likewise.
* config/nds32/nds32-memory-manipulation.cc (nds32_expand_cpymemsi_unroll): Likewise.
(nds32_expand_load_multiple): Likewise.
* config/nds32/nds32-multiple.md: Likewise.
* config/nds32/nds32-n7.md: Likewise.
* config/nds32/nds32-n8.md: Likewise.
* config/nds32/nds32-n9-2r1w.md: Likewise.
* config/nds32/nds32-pipelines-auxiliary.cc (extract_nth_access_reg): Likewise.
(pbsada_insn_ra_rb_dep_reg_p): Likewise.
* config/nds32/nds32-predicates.cc (nds32_can_use_bset_p): Likewise.
(nds32_can_use_btgl_p): Likewise.
(nds32_symbol_load_store_p): Likewise.
* config/nds32/nds32-protos.h (nds32_cond_move_p): Likewise.
(nds32_mem_format): Likewise.
* config/nds32/nds32-relax-opt.cc (nds32_plus_reg_load_store_p): Likewise.
* config/nds32/nds32-utils.cc (extract_offset_rtx): Likewise.
* config/nds32/nds32.cc (nds32_compute_stack_frame): Likewise.
(nds32_emit_stack_pop_multiple): Likewise.
(nds32_emit_stack_v3pop): Likewise.
(nds32_can_change_mode_class): Likewise.
(nds32_arg_partial_bytes): Likewise.
(nds32_function_ok_for_sibcall): Likewise.
(nds32_register_move_cost): Likewise.
(nds32_print_operand): Likewise.
(nds32_merge_decl_attributes): Likewise.
(nds32_insert_attributes): Likewise.
(nds32_init_libfuncs): Likewise.
(nds32_expand_epilogue_v3pop): Likewise.
(nds32_can_use_return_insn): Likewise.
(nds32_target_alignment): Likewise.
(nds32_split_double_word_load_store_p): Likewise.
* config/nds32/nds32.h (enum nds32_builtins): Likewise.
(CASE_VECTOR_MODE): Likewise.
* config/nds32/nds32.md: Likewise.
* config/nds32/nds32_intrinsic.h (__attribute__): Likewise.
* config/nds32/nds32_isr.h: Likewise.

libgcc/ChangeLog:

* config/nds32/initfini.c: Fix typos.
* config/nds32/linux-atomic.c: Likewise.

5 days agomsp430: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:43:41 +0000 (11:43 +0000)] 
msp430: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/msp430/msp430-opts.h (enum msp430_cpu_types): Fix typos.
* config/msp430/msp430.cc (msp430_op_not_in_high_mem): Likewise.
* config/msp430/msp430.md: Likewise.

5 days agomingw: Fix typo in winnt-cxx.cc
Dhruv Chawla [Wed, 20 May 2026 11:42:44 +0000 (11:42 +0000)] 
mingw: Fix typo in winnt-cxx.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/mingw/winnt-cxx.cc (i386_pe_adjust_class_at_definition): Fix
typos.

5 days agomicroblaze: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:41:39 +0000 (11:41 +0000)] 
microblaze: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/microblaze/microblaze.cc (struct microblaze_frame_info): Fix
typos.
(compute_frame_size): Likewise.
* config/microblaze/microblaze.h: Likewise.

5 days agomcore: Fix typo in mcore.h
Dhruv Chawla [Wed, 20 May 2026 11:40:58 +0000 (11:40 +0000)] 
mcore: Fix typo in mcore.h

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/mcore/mcore.h: Fix typo.

5 days agomips: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:40:33 +0000 (11:40 +0000)] 
mips: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/mips/driver-native.cc (host_detect_local_cpu): Fix typos.
* config/mips/mips-cpus.def (MIPS_CPU): Likewise.
* config/mips/mips.cc (mips_setup_incoming_varargs): Likewise.
(mips_function_ok_for_sibcall): Likewise.
(mips_expand_ext_as_unaligned_load): Likewise.
(mips_use_ins_ext_p): Likewise.
(mips_pop_asm_switch): Likewise.
(mips_cfun_has_inflexible_gp_ref_p): Likewise.
(mips_set_compression_mode): Likewise.
(mips_expand_vec_unpack): Likewise.
* config/mips/mips.h (while): Likewise.
* config/mips/mips.md: Likewise.

libgcc/ChangeLog:

* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.

5 days agom68k: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:39:12 +0000 (11:39 +0000)] 
m68k: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/m68k/cf.md: Fix typos.
* config/m68k/m68k.cc (m68k_unwrap_symbol): Likewise.
(m68k_adjust_decorated_operand): Likewise.
(m68k_call_tls_get_addr): Likewise.
(m68k_call_m68k_read_tp): Likewise.
(m68k_sched_attr_size): Likewise.
(m68k_sched_dfa_post_advance_cycle): Likewise.
(sched_mem_operand_p): Likewise.
(m68k_sched_address_bypass_p): Likewise.
* config/m68k/m68kelf.h: Likewise.
* config/m68k/netbsd-elf.h (REGISTER_PREFIX): Likewise.

5 days agoloongarch: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:37:44 +0000 (11:37 +0000)] 
loongarch: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/loongarch/lasx.md: Fix typos.
* config/loongarch/loongarch-builtins.cc: Likewise.
* config/loongarch/loongarch-c.cc (loongarch_pragma_target_parse): Likewise.
* config/loongarch/loongarch-opts.cc (loongarch_generate_mrecip_scheme): Likewise.
* config/loongarch/loongarch-opts.h (loongarch_config_target): Likewise.
* config/loongarch/loongarch.cc (loongarch_setup_incoming_varargs): Likewise.
(loongarch_build_integer): Likewise.
(loongarch_explicit_relocs_p): Likewise.
(loongarch_valid_lo_sum_p): Likewise.
(loongarch_addu16i_imm12_operand_p): Likewise.
(loongarch_rewrite_mem_for_simple_ldst): Likewise.
(loongarch_is_elem_duplicate): Likewise.
(loongarch_expand_vec_perm_const): Likewise.
(loongarch_sched_reassociation_width): Likewise.
(loongarch_expand_vec_unpack): Likewise.
(dispatch_function_versions): Likewise.
(loongarch_option_same_function_versions): Likewise.
* config/loongarch/loongarch.h: Likewise.
* config/loongarch/loongarch.md: Likewise.
* config/loongarch/lsx.md: Likewise.
* config/loongarch/predicates.md: Likewise.
* config/loongarch/simd.md: Likewise.
* config/loongarch/sync.md: Likewise.

5 days agolm32: Fix typo in lm32.cc
Dhruv Chawla [Wed, 20 May 2026 11:35:02 +0000 (11:35 +0000)] 
lm32: Fix typo in lm32.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/lm32/lm32.cc (lm32_compute_frame_size): Fix typos.

5 days agoia64: Fix typos in various files
Dhruv Chawla [Wed, 20 May 2026 11:34:31 +0000 (11:34 +0000)] 
ia64: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/ia64/ia64.cc (ia64_add_bundle_selector_before): Fix typos.
* config/ia64/itanium2.md: Likewise.
* config/ia64/sync.md: Likewise.

5 days agoi386: Fix typos in various files
Dhruv Chawla [Tue, 19 May 2026 13:09:50 +0000 (13:09 +0000)] 
i386: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/i386/athlon.md: Fix typos.
* config/i386/avx512fintrin.h: Likewise.
* config/i386/btver2.md: Likewise.
* config/i386/c86-4g-m7.md: Likewise.
* config/i386/c86-4g.md: Likewise.
* config/i386/cygwin.h: Likewise.
* config/i386/i386-c.cc (ix86_target_macros_internal): Likewise.
* config/i386/i386-expand.cc (ix86_expand_branch): Likewise.
(ix86_expand_int_sse_cmp): Likewise.
(ix86_expand_vec_perm): Likewise.
(expand_small_cpymem_or_setmem): Likewise.
(ix86_copy_addr_to_reg): Likewise.
(ix86_expand_special_args_builtin): Likewise.
(ix86_expand_vector_init_interleave): Likewise.
(expand_vec_perm_shufps_shufps): Likewise.
(ix86_expand_sse2_mulvxdi3): Likewise.
(ix86_gen_ccmp_first): Likewise.
* config/i386/i386-features.cc (general_scalar_to_vector_candidate_p): Likewise.
(pass_x86_cse::x86_cse): Likewise.
(ix86_apx_nf_convert): Likewise.
(dispatch_function_versions): Likewise.
* config/i386/i386-features.h (class scalar_chain): Likewise.
* config/i386/i386-options.cc (ix86_function_specific_restore): Likewise.
(ix86_valid_target_attribute_tree): Likewise.
(ix86_override_options_after_change_1): Likewise.
(ix86_option_override_internal): Likewise.
* config/i386/i386.cc (ix86_can_inline_p): Likewise.
(ix86_function_regparm): Likewise.
(construct_container): Likewise.
(ix86_return_in_memory): Likewise.
(output_indirect_thunk): Likewise.
(ix86_compute_frame_layout): Likewise.
(choose_basereg): Likewise.
(ix86_emit_save_reg_using_mov): Likewise.
(pro_epilogue_adjust_stack): Likewise.
(ix86_expand_prologue): Likewise.
(ix86_emit_restore_sse_regs_using_mov): Likewise.
(ix86_memory_address_reg_class): Likewise.
(ix86_avx_u128_mode_after): Likewise.
(ix86_output_addr_diff_elt): Likewise.
(ix86_lea_outperforms): Likewise.
(ix86_avoid_lea_for_addr): Likewise.
(ix86_cc_modes_compatible): Likewise.
(add_parameter_dependencies): Likewise.
(ix86_data_alignment): Likewise.
(ix86_gimple_fold_builtin): Likewise.
(ix86_autovectorize_vector_modes): Likewise.
(ix86_max_noce_ifcvt_seq_cost): Likewise.
(ix86_vector_costs::add_stmt_cost): Likewise.
(ix86_vector_costs::finish_cost): Likewise.
(ix86_optab_supported_p): Likewise.
(ix86_push_rounding): Likewise.
* config/i386/i386.h (host_detect_local_cpu): Likewise.
(enum reg_class): Likewise.
* config/i386/i386.md: Likewise.
* config/i386/i386elf.h: Likewise.
* config/i386/predicates.md: Likewise.
* config/i386/sse.md: Likewise.
* config/i386/x86-tune-costs.h (struct processor_costs): Likewise.
* config/i386/x86-tune-sched-atom.cc (swap_top_of_ready_list): Likewise.
(ix86_atom_sched_reorder): Likewise.
* config/i386/x86-tune-sched-bd.cc (find_constant): Likewise.
* config/i386/x86-tune-sched.cc (exact_store_load_dependency): Likewise.
* config/i386/x86-tune.def (X86_TUNE_FUSE_MOV_AND_ALU): Likewise.
(X86_TUNE_PREFER_KNOWN_REP_MOVSB_STOSB): Likewise.
(X86_TUNE_DOUBLE_WITH_ADD): Likewise.
(X86_TUNE_PROMOTE_QIMODE): Likewise.
* config/i386/zn4zn5.md: Likewise.
* config/i386/znver.md: Likewise.

5 days agogcn: Fix typos in various files
Dhruv Chawla [Tue, 19 May 2026 13:03:19 +0000 (13:03 +0000)] 
gcn: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/gcn/constraints.md: Fix typos.
* config/gcn/gcn-opts.h (TARGET_ARCHITECTED_FLAT_SCRATCH): Likewise.
* config/gcn/gcn-valu.md: Likewise.
* config/gcn/gcn.cc (gcn_gen_undef): Likewise.
(gcn_addr_space_debug): Likewise.
(gcn_expand_prologue): Likewise.
(gcn_frame_pointer_rqd): Likewise.
* config/gcn/gcn.h (NUM_PARM_REGS): Likewise.
(enum gcn_builtin_codes): Likewise.
* config/gcn/gcn.md: Likewise.

5 days agoft32: Fix typos in ft32.cc
Dhruv Chawla [Tue, 19 May 2026 13:01:00 +0000 (13:01 +0000)] 
ft32: Fix typos in ft32.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/ft32/ft32.cc (ft32_init_machine_status): Fix typos.

5 days agofrv: Fix typos in frv-opts.h
Dhruv Chawla [Tue, 19 May 2026 13:00:22 +0000 (13:00 +0000)] 
frv: Fix typos in frv-opts.h

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/frv/frv-opts.h: Fix typos.

5 days agofr30: Fix typos in fr30.cc
Dhruv Chawla [Tue, 19 May 2026 12:59:24 +0000 (12:59 +0000)] 
fr30: Fix typos in fr30.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/fr30/fr30.cc (fr30_const_double_is_zero): Fix typos.

5 days agoepiphany: Fix typos in various files
Dhruv Chawla [Tue, 19 May 2026 12:58:33 +0000 (12:58 +0000)] 
epiphany: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/epiphany/epiphany.cc (epiphany_expand_epilogue): Fix typos.
* config/epiphany/resolve-sw-modes.cc: Likewise.

5 days agocsky: Fix typos in csky.cc
Dhruv Chawla [Tue, 19 May 2026 12:57:47 +0000 (12:57 +0000)] 
csky: Fix typos in csky.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/csky/csky.cc (csky_output_inline_const): Fix typos.
(emit_csky_regs_pop): Likewise.
(csky_return_in_memory): Likewise.

5 days agoc6x: Fix typos in c6x.cc
Dhruv Chawla [Tue, 19 May 2026 12:57:00 +0000 (12:57 +0000)] 
c6x: Fix typos in c6x.cc

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/c6x/c6x.cc (c6x_file_start): Fix typos.
(c6x_print_operand_address): Likewise.
(c6x_asm_emit_except_personality): Likewise.

5 days agobpf: Fix typos in various files
Dhruv Chawla [Tue, 19 May 2026 12:56:17 +0000 (12:56 +0000)] 
bpf: Fix typos in various files

Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
gcc/ChangeLog:

* config/bpf/bpf.cc (bpf_asm_named_section): Fix typos.
* config/bpf/core-builtins.cc (remove_parser_plugin): Likewise.
(make_core_relo): Likewise.
(bpf_handle_plugin_finish_type): Likewise.
(bpf_output_core_reloc): Likewise.
(core_make_builtins): Likewise.