[PATCH] Fix questionable optimization of short-circuit operators

2025-06-10 Thread Eric Botcazou
Hi, the compiler can swap the operands of the short-circuit operators in some cases, which can be problematic for tools like Valgrind that detect uses of uninitialized data, and is probably counterproductive in most cases. The change prevents this from occurring, but also extends the use of jum

[Patch] [+wwwdocs] gcn: Add experimental MI300 (gfx942) support

2025-06-10 Thread Tobias Burnus
This add experimental support for AMD Instinct MI300. It has been tested to support hello world, but not yet much beyond (to come). OK for mainline? Tobias gcn: Add experimental MI300 (gfx942) support As gfx942 and gfx950 belong to gfx9-4-generic, the latter two are also added. Note that there

[COMMITTED 20/30] ada: Fix fallout of latest change

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou Freeze_Static_Object needs to deal with the objects that have been created by Insert_Conditional_Object_Declaration. gcc/ada/ChangeLog: * freeze.adb (Freeze_Static_Object): Do not issue any error message for compiler-generated entities. Tested on x86_64-pc-l

Re: [AutoFDO] Profile merging for clone test

2025-06-10 Thread Jan Hubicka
> Hi, > > > On 4 Jun 2025, at 9:53 pm, Jan Hubicka wrote: > > > > External email: Use caution opening links or attachments > > > > > >> This patch introduces a new testcase to verify the merging of profiles > >> is performed for cloned functions. > >> > >> Since this is invoked very early, be

[COMMITTED 02/30] ada: Add assertion on expanded code in particular case

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques This patch adds an assertion that checks that expanded code does not contain erroneous access subtype definitions. gcc/ada/ChangeLog: * sem_ch3.adb (Process_Subtype): Add assertion. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb |

[COMMITTED 15/30] ada: Storage_Error on Ordered_Maps container aggregate with enumeration Key_Type

2025-06-10 Thread Marc Poulhiès
From: Gary Dismukes The compiler fails with a Storage_Error when compiling a container aggregate for a Map type coming from an instantiation of Ada.Containers.Ordered_Maps that specifies an enumeration type for the Key_Type formal. gcc/ada/ChangeLog: * exp_aggr.adb (Build_Container_Aggr

[COMMITTED 10/30] ada: Fix use-after-free in Compute_All_Tasks

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a bug in System.Stack_Usage.Tasking.Compute_All_Tasks where it would attempt to read the stack of threads that had already completed. gcc/ada/ChangeLog: * libgnarl/s-stusta.adb (Compute_All_Tasks): Skip terminated tasks. Tested on x86_64-pc-linu

[COMMITTED 13/30] ada: Rename constant in Analyze_Component_Declaration

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques "Typ" is typically used to name constants that are entity IDs for types. Before this patch, a constant local to Analyze_Component_Declaration designating a syntactic subtype indication had that name. This patch renames it to "Ind". Code cleanup; behavior is unaffected. g

[COMMITTED 08/30] ada: Fix Value_Decimal to raise Constraint_Error on boundary values

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou Even though the issue is not user-visible, it's a (minor) departure from the specification of the procedure. gcc/ada/ChangeLog: * libgnat/s-valued.adb (Integer_to_Decimal): Add Extra parameter and use its value to call Bad_Value on boundary values. (S

[COMMITTED 11/30] ada: Fix infinite loop with aggregate in generic unit

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou Root_Type does not return the same type for the private and the full view of a derived private tagged type when both derive from an interface type. gcc/ada/ChangeLog: * sem_ch12.adb (Copy_Generic_Node): Do not call Root_Type to find the root type of an aggreg

[COMMITTED 17/30] ada: Fix inconsistent comment for fixed-point Value attribute implementation

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou The comment incorrectly mentions decimal fixed point. gcc/ada/ChangeLog: * libgnat/s-vafi32.ads: Fix head description. * libgnat/s-vafi64.ads: Likewise. * libgnat/s-vafi128.ads: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/

[COMMITTED 16/30] ada: VAST: create treewalker

2025-06-10 Thread Marc Poulhiès
From: Bob Duff Walks all trees (not just the main unit), deals with switches and flags. Doesn't check much of anything yet (asserts that "unused" nodes are not present). Move decisions (what tree(s) to check, what switches enable checking) from the caller to the body of VAST. gcc/ada/ChangeLog:

[COMMITTED 07/30] ada: Add Incomplete_Type_OK formal to Process_Subtype

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, Process_Subtype looked at the parent of its argument to determine whether it was called in a context where it was OK for the subtype mark to refer to the incomplete view of a type. This patch adds a new formal so that it becomes the responsibility of the

[COMMITTED 14/30] ada: Fix omission in comment

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * sem_ch3.adb (Find_Type_Of_Object): Fix comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb inde

[COMMITTED 18/30] ada: Fix wrong initialization of library-level object by conditional expression

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou The previous fix was not robust enough in the presence of transient scopes. gcc/ada/ChangeLog: * exp_ch4.adb (Insert_Conditional_Object_Declaration): Deal with a transient scope being created around the declaration. * freeze.adb (Freeze_Entity): Do no

[COMMITTED 19/30] ada: VAST: treewalker improvements

2025-06-10 Thread Marc Poulhiès
From: Bob Duff Implement two basic checks: Check that N_Error nodes cannot appear in the tree (because VAST is not called when the source is illegal). Check that every node has a parent, except for certain nodes where we check the opposite. (We do not yet check that the parent pointers actually p

[COMMITTED 22/30] ada: Special case for inconsistent pointer in Scan_Raw_Unsigned

2025-06-10 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * libgnat/s-valueu.adb: add explict raise * libgnat/s-valueu.ads: update annotation Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-valueu.adb | 9 + gcc/ada/libgnat/s-valueu.ads | 8 +++- 2 files changed

[COMMITTED 24/30] ada: VAST found bug: Itypes with Parent

2025-06-10 Thread Marc Poulhiès
From: Bob Duff Fix the comment about Itypes, so the Parent field is no longer required. Change VAST to no longer require it. Remove Check_Itype_Parents from Check_Enum; it can no longer fail, so there's no point in making it switchable. gcc/ada/ChangeLog: * einfo.ads (Associated_Node_F

[COMMITTED 09/30] ada: Fix the detection of configuration pragmas

2025-06-10 Thread Marc Poulhiès
From: Viljar Indus Some pragma nodes like the ones for Assertion_Policy are replaced by a Null_Statement. This is not taken into account when analyzing if the pragma is a configuration pragma. gcc/ada/ChangeLog: * sem_prag.adb (Is_Configuration_Pragma): Check that nodes precedin

[COMMITTED 25/30] ada: Factorize some duplicate code

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques Process_Subtype can be passed either a subtype indication or a subtype mark. Before this patch, it branched directly depending on the kind of the argument, but there actually was processing common to the two branches like resolving the subtype mark. This patch factorizes t

[COMMITTED 05/30] ada: Rename a couple of local variables

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou Block_Node is the name of an entity field, so the change renames local variables with this name for the sake of clarity. gcc/ada/ChangeLog: * par-ch5.adb (P_Declare_Statement): Rename local variable. (P_Begin_Statement): Likewise. Tested on x86_64-pc-linux-g

[PATCH] testsuite: Fix pr119160.c for non-glibc targets [PR119862]

2025-06-10 Thread Konstantinos Eleftheriou
Testcase pr119160.c fails with symbol referencing errors for `__cyg_profile_func_enter` and `__cyg_profile_func_exit` on non-glibc systems. This patch adds empty definitions for `__cyg_profile_func_enter` and `__cyg_profile_func_exit` in order to prevent those errors. PR testsuite/119862

[COMMITTED 06/30] ada: Fix recursive call in Process_Subtype

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques Process_Subtype calls itself in some error situations. This recursive call was not updated together with the recent addition of the Excludes_Null formal. This does not matter in practice because there can never be both a null exclusion and another constraint at the same ti

[COMMITTED 04/30] ada: Remove outdated comment about reused entity fields

2025-06-10 Thread Marc Poulhiès
From: Piotr Trojanek With the current representation of GNAT AST the entity fields are not reused. gcc/ada/ChangeLog: * einfo.ads (Overridden_Operation, Static_Initialization): Remove comments about a reused entity field. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED 01/30] ada: Factorize initialization of local variable

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * sem_ch3.adb (Process_Subtype): Factorize initialization of variable. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch3.adb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcc/ada/sem_ch3.adb b/gc

[COMMITTED 03/30] ada: Tweak formatting in Process_Subtype

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques This patch removes parentheses and vertical alignment that misleadingly suggested the presence of function calls where there weren't any. gcc/ada/ChangeLog: * sem_ch3.adb (Process_Subtype): Tweak formatting. Tested on x86_64-pc-linux-gnu, committed on master. -

Re: [PATCH] libstdc++: Make __max_size_type and __max_diff_type structural

2025-06-10 Thread Tomasz Kaminski
On Tue, Jun 10, 2025 at 5:22 AM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > LGTM. I think this change makes sense, and we should consider requiring that in standard. For example, with reflections, this allows reflect_constant to store distance for all rang

[PATCH] libstdc++: add range support to std::optional (P3168)

2025-06-10 Thread Giuseppe D'Angelo
Hello, The attached patch implements C++26's range support for std::optional. It's also available on Forge here: https://forge.sourceware.org/gcc/gcc-TEST/pulls/54 It's mostly straightforward, but I had to lift format_kind out of (together with a few other helpers) to avoid to depend on th

[COMMITTED 21/30] ada: Move Check_Discriminant_Conformance to Sem_Ch3

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques Check_Discriminant_Conformance is really only about concepts defined in chapter 3 of the Ada reference manual, so it fits better in Sem_Ch3 than in Sem_Ch6. gcc/ada/ChangeLog: * sem_ch6.adb, sem_ch6.ads (Check_Discriminant_Conformance): Move to … * sem_ch

[COMMITTED 12/30] ada: Simplify Constrain_Array

2025-06-10 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, Constrain_Array had a feature where it could be passed Empty for the first actual and would then create an Itype itself. There was only one use of this feature and it was unnecessary, so this patch removes it. gcc/ada/ChangeLog: * sem_ch3.adb (

[COMMITTED 27/30] ada: Small cleanup in instantiation of generic bodies

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou This removes the code dealing with generic main units from the body of the instantiation routine, namely Instantiate_Bodies, and replaces it by tests done earlier in the processing. The test added to Need_Subprogram_Instance_Body is already present in the twin predicate Needs

[COMMITTED 28/30] ada: Minor comment tweak

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou This replaces a couple of occurrences of "function" by "subprogram". gcc/ada/ChangeLog: * inline.adb (Analyze_Inlined_Bodies): Minor comment tweak. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/inline.adb | 6 +++--- 1 file changed, 3 insertions(

[COMMITTED 26/30] ada: Do not install the support files of 128-bit types on 32-bit targets

2025-06-10 Thread Marc Poulhiès
From: Eric Botcazou The files are not compiled into libgnat.a but are nevertheless installed in the adainclude directory, which is unwanted. gcc/ada/ChangeLog: * Makefile.rtl (ADA_EXCLUDE_SRCS): Add the 128-bit support files. Tested on x86_64-pc-linux-gnu, committed on master. --- gc

Re: [PATCH v5 06/24] Refactor record_function_versions.

2025-06-10 Thread Alfie Richards
On 5/29/25 6:46 AM, Alfie Richards wrote: Renames record_function_versions to add_function_version, and make it explicit that it is adding a single version to the function structure. Additionally, change the insertion point to always maintain priority ordering of the versions. This allows for

[COMMITTED 29/30] ada: Remove redundant guard against attribute with no expressions

2025-06-10 Thread Marc Poulhiès
From: Piotr Trojanek We intentionally allow First to work on No_List, so there is no need to guard against a No_List. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_attr.adb (Resolve_Attribute): Remove redundant guard. Tested on x86_64-pc-linux-gnu, committed on master

[COMMITTED 23/30] ada: Error on subtype with static predicate used in case_expression

2025-06-10 Thread Marc Poulhiès
From: Gary Dismukes The compiler improperly flags an error on the use of a subtype with a static predicate as a choice in a case expression alternative, complaining that the subtype has a nonstatic predicate. The fix for this is to add a test for the subtype not having a static predicate. gcc/ad

[COMMITTED 30/30] ada: Generic formal objects have no entry components

2025-06-10 Thread Marc Poulhiès
From: Piotr Trojanek AST field Entry_Component doesn't make sense for generic formal objects and was never used there. Code cleanup; behavior is unaffected. gcc/ada/ChangeLog: * gen_il-gen-gen_entities.adb (Formal_Object_Kind): Remove Entry_Component field. Tested on x86_64-pc-

Re: [RFC PATCH v1 10/31] LoongArch: Disable extreme code model for crtbeginS.o on LA32

2025-06-10 Thread Xi Ruoyao
On Tue, 2025-06-10 at 16:55 +0800, mengqinggang wrote: > LA32 does not support extreme code mode, change to normal code model. > Some libgcc/configure changes cause by 9e46fd072bc90ba6f7af commit. > --- >  libgcc/config/loongarch/t-crtstuff-la32   |  5 + >  .../loongarch/{t-crtstuff => t-cr

Re: [RFC PATCH v1 08/31] LoongArch: Forbid ADDRESS_REG_REG in loongarch32

2025-06-10 Thread Xi Ruoyao
On Tue, 2025-06-10 at 16:55 +0800, mengqinggang wrote: > From: Jiajie Chen > > LoongArch32 does not include LDX/STX instructions, and cannot lower > (plus (reg) (reg)) pattern. Forbid ADDRESS_REG_REG and do not emit (mem (plus (reg) (reg))) /* snip */ > diff --git a/gcc/testsuite/gcc.target/lo

Re: [PATCH] libstdc++: Make __max_size_type and __max_diff_type structural

2025-06-10 Thread Jonathan Wakely
On Tue, 10 Jun 2025 at 04:23, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > -- >8 -- > > This patch makes these integer-class types structural types by > public-izing their data memberss so that they could be used as NTTP s/memberss/members/ OK for trunk

Re: [RFC PATCH v1 25/31] LoongArch: macro instead enum for base abi type

2025-06-10 Thread Xi Ruoyao
On Tue, 2025-06-10 at 17:00 +0800, mengqinggang wrote: > enum can't be used in #if. > For #if expression, identifiers that are not macros, > which are all considered to be the number zero. Ooops :(. > This patch may fix > https://sourceware.org/bugzilla/show_bug.cgi?id=32776. > > gcc/ChangeLog:

Re: [PATCH] expand, ranger: Use ranger during expansion [PR120434]

2025-06-10 Thread Jakub Jelinek
On Mon, Jun 09, 2025 at 07:46:28PM +0200, Jakub Jelinek wrote: > > So using, say, get_all_dominated_blocks (we free dominators, possibly > > PHI expansion might insert on edges) to get a PRE ordered set of > > I think PHI expansion does insert on edges. As for whether to expand in some different

Re: [RFC PATCH v1 13/31] LoongArch: Forbid stptr/ldptr when enable -fshrink-wrap.

2025-06-10 Thread Xi Ruoyao
On Tue, 2025-06-10 at 16:55 +0800, mengqinggang wrote: > Change condition to IMM12_OPERAND (offset) on LA32. > > gcc/ChangeLog: > > * config/loongarch/loongarch.cc > (loongarch_get_separate_components): > Change max offset for LA32. > --- >  gcc/config/loongarch/loongarch.cc | 3 ++- >

Re: [RFC PATCH v1 16/31] LoongArch: Add support for atomic on LA32

2025-06-10 Thread Xi Ruoyao
On Tue, 2025-06-10 at 16:59 +0800, mengqinggang wrote: > Add support for atomic_, > atomic_fetch_, > atomic_exchange on LA32. > > gcc/ChangeLog: > > * config/loongarch/sync.md: Add la32 support. > --- >  gcc/config/loongarch/sync.md | 56 ++-- >  1 file chang

Re: [PATCH] c, c++: Save 8 bytes of memory in lang_type for non-ObjC*

2025-06-10 Thread Richard Biener
On Mon, Jun 9, 2025 at 7:28 PM Jakub Jelinek wrote: > > Hi! > > For C++26 P2786R13 I'm afraid I'll need 4 new flags on class types > in struct lang_type (1 bit for trivially_relocatable_if_eligible, > 1 for replaceable_if_eligible, 1 for not_trivially_relocatable and > 1 for not_replaceable) and t

Re: [PATCH 09/14] aarch64: Add support for unpacked SVE FDIV

2025-06-10 Thread Richard Sandiford
Spencer Abson writes: > On Fri, Jun 06, 2025 at 12:46:32PM +0100, Richard Sandiford wrote: >> Spencer Abson writes: >> > This patch extends the unpredicated FP division expander to support >> > partial FP modes. It extends the existing patterns used to implement >> > UNSPEC_COND_FDIV and it's ap

Re: [PATCH] RISC-V: testsuite: fix an obvious build error

2025-06-10 Thread Robin Dapp
OK. -- Regards Robin

c: clean up some functions in c-typeck.cc

2025-06-10 Thread Martin Uecker
When looking for the casue of PR120510 I noticed there is some minor issues that make the code harder to understand which are left over from previous changes. Bootstrapped and regression tested for x86_64. c: clean up some functions in c-typeck.cc This removes two unnecessary vari

[PATCH v4 2/6] dwarf: create annotation DIEs for btf tags

2025-06-10 Thread David Faust
The btf_decl_tag and btf_type_tag attributes provide a means to annotate declarations and types respectively with arbitrary user provided strings. These strings are recorded in debug information for post-compilation uses, and despite the name they are meant to be recorded in DWARF as well as BTF.

[PATCH v4 0/6] c, dwarf, btf: Add btf_decl_tag and btf_type_tag C attributes

2025-06-10 Thread David Faust
[v3: https://gcc.gnu.org/pipermail/gcc-patches/2025-April/682340.html Changes v3->v4: - Only patch 2 (DWARF generation) is changed; update based on Richard's review comments. - Fix an issue with generating DWARF for type_tags when a typedef involves type_tags and the use of the typedef add

[PATCH v4 1/6] c-family: add btf_type_tag and btf_decl_tag attributes

2025-06-10 Thread David Faust
Add two new c-family attributes, "btf_type_tag" and "btf_decl_tag" along with a simple shared handler for them. gcc/c-family/ * c-attribs.cc (c_common_attribute_table): Add btf_decl_tag and btf_type_tag attributes. (handle_btf_tag_attribute): New handler for both new attrib

[pushed: r16-1405] diagnostics: xml: add add_text_from_pp

2025-06-10 Thread David Malcolm
Various places use xp.add_text (pp_formatted_text (&pp)) Add a helper function for this. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-1405-g896edb1d0ae90f. gcc/ChangeLog: * diagnostic-path-output.cc: Use xml::printe

[pushed: r16-1404] diagnostics: fix tag nesting issues in experimental-html sink [PR120610]

2025-06-10 Thread David Malcolm
I've been seeing issues in the experimental-html sink where the nesting of tags goes wrong. The two issues I've seen are: * the pp_token_list from the diagnostic message that reaches the html_token_printer doesn't always have matching pairs of begin/end tokens (PR other/120610) * a bug in diag

[pushed: r16-1403] gimple-ssa-warn-access: add missing auto_diagnostic_group

2025-06-10 Thread David Malcolm
Spotted whilst implementing nesting support in the experimental-html diagnostic sink. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-1403-gb619b4d7e7a507. gcc/ChangeLog: * gimple-ssa-warn-access.cc (pass_waccess::maybe_check_dealloc_call): Ad

Gimple lowering question

2025-06-10 Thread Andrew MacLeod
I had a question asked of me, and now I'm passing the buck. extern void *memcpy(void *, const void *, unsigned int); extern int memcmp(const void *, const void *, unsigned int); typedef unsigned long bits32; typedef unsigned char byte; static const byte orig[10] = {    'J', '2

Re: [PATCH v4 1/3][C FE]Extend "counted_by" attribute to pointer fields of structures.

2025-06-10 Thread Joseph Myers
On Tue, 13 May 2025, Qing Zhao wrote: > + /* This attribute cannot be applied to a pointer type whose pointee type > + is void. */ > + else if (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE > +&& TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == VOID_TYPE) > +{ > + error_at (DECL_

[PATCH v4 5/6] doc: document btf_type_tag and btf_decl_tag attributes

2025-06-10 Thread David Faust
gcc/ * doc/extend.texi (Common Function Attributes) (Common Variable Attributes): Document btf_decl_tag attribute. (Common Type Attributes): Document btf_type_tag attribute. --- gcc/doc/extend.texi | 79 + 1 file changed, 79 inser

Re: [PATCH] c: fix ICE for invalid code in generic selection [PR120303]

2025-06-10 Thread Joseph Myers
On Tue, 10 Jun 2025, Martin Uecker wrote: > Small fix. > > Bootstrapped and regression tested for x86_64. > > Martin > > c: fix ICE for invalid code in generic selection [PR120303] > > Fix an error recovery ICE that occurs when a type name > can not be parsed correctly in the c

[PATCH v4 4/6] btf: generate and output DECL_TAG and TYPE_TAG records

2025-06-10 Thread David Faust
Support the btf_decl_tag and btf_type_tag attributes in BTF by creating and emitting BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG records, respectively, for them. Some care is required when -gprune-btf is in effect to avoid emitting decl or type tags for declarations or types which have been pruned and

Re: c: clean up some functions in c-typeck.cc

2025-06-10 Thread Joseph Myers
On Tue, 10 Jun 2025, Martin Uecker wrote: > When looking for the casue of PR120510 I noticed there > is some minor issues that make the code harder to understand > which are left over from previous changes. > > Bootstrapped and regression tested for x86_64. > > > c: clean up some functions

RE: [PATCH] x86: Enable separate shrink wrapping

2025-06-10 Thread Cui, Lili
> > gcc/testsuite/ChangeLog: > > > > * gcc.target/x86_64/abi/callabi/leaf-2.c: Adjust the test. > > * gcc.target/i386/interrupt-16.c: Likewise. > > * g++.target/i386/shrink_wrap_separate.c: New test. > > This one should have .C suffix. > Done. > Some comment fixes/clarif

Re: [PATCH] expand, ranger: Use ranger during expansion [PR120434]

2025-06-10 Thread Andrew MacLeod
On 6/10/25 13:52, Jakub Jelinek wrote: On Tue, Jun 10, 2025 at 10:51:25AM -0400, Andrew MacLeod wrote: Edge range should be fine, and really that assert doesnt really need to be there. Where the issue could arise is in gimple-range-fold.cc in fold_using_range::range_of_range_op()  where we se

Re: [PATCH 13/14] aarch64: Relaxed SEL combiner patterns for unpacked SVE FP ternary arithmetic

2025-06-10 Thread Richard Sandiford
Spencer Abson writes: > On Fri, Jun 06, 2025 at 04:04:18PM +0100, Richard Sandiford wrote: >> Spencer Abson writes: >> > Extend the ternary op/UNSPEC_SEL combiner patterns from SVE_FULL_F/ >> > SVE_FULL_F_BF to SVE_F/SVE_F_BF, where the strictness value is >> > SVE_RELAXED_GP. >> > >> > We can on

Re: [PATCH 11/14] aarch64: Add support for unpacked SVE FP conditional binary arithmetic

2025-06-10 Thread Richard Sandiford
Spencer Abson writes: > On Fri, Jun 06, 2025 at 03:52:12PM +0100, Richard Sandiford wrote: >> Spencer Abson writes: >> > @@ -8165,20 +8169,25 @@ >> > ;; >> > ;; For unpacked vectors, it doesn't really matter whether SEL uses the >> > ;; the container size or the element size. If SEL used the

[pushed: r16-1406] diagnostics: make experimental-html sink prettier [PR116792]

2025-06-10 Thread David Malcolm
This patch to the "experimental-html" diagnostic sink: * adds use of the PatternFly 3 CSS library (via an optional link in the generated html to a copy in a CDN) * uses PatternFly's "alert" pattern to show severities for diagnostics, properly nesting "note" diagnostics for diagnostic groups.

[wwwdocs] Add C status page (C11 table)

2025-06-10 Thread Marek Polacek
This patch adds a C11 status table to c-status.html. I consulted n3220.pdf (M.4) and https://gcc.gnu.org/wiki/C11Status, and checked that Implemented in Version is correct. I've added links to proposals where it seemed relevant. Also add a small note about C17. W3 validated. Ok? --- htdocs/gcc-

[PATCH v4 3/6] ctf: translate annotation DIEs to internal ctf

2025-06-10 Thread David Faust
Translate DW_TAG_GNU_annotation DIEs created for C attributes btf_decl_tag and btf_type_tag into an in-memory representation in the CTF/BTF container. They will be output in BTF as BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG records. The new CTF kinds used to represent these annotations, CTF_K_DECL_T

[PATCH] c: remaining fix for the composite type inconsistency [PR120510]

2025-06-10 Thread Martin Uecker
Joseph, this fixes the remaining issue related to PR120510. It is related to this GNU extenions: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Function-Prototypes.html#Function-Prototypes Here I simply override the type with the one with the prototype. This is not a perfect replacement for for

[PATCH v4 6/6] bpf: add tests for CO-RE and BTF tag interaction

2025-06-10 Thread David Faust
Add a couple of tests to ensure that BTF type/decl tags do not interfere with generation of BPF CO-RE relocations. gcc/testsuite/ * gcc.target/bpf/core-btf-tag-1.c: New test. * gcc.target/bpf/core-btf-tag-2.c: New test. --- gcc/testsuite/gcc.target/bpf/core-btf-tag-1.c | 23 ++

Re: [COMMITTED] Check if constant is a member before returning it.

2025-06-10 Thread Sam James
Andrew MacLeod writes: > There is a bug in irange::set_range_from_bitmask where if the bitmask > indicated the result is a singleton, it would simply return that > singleton.  It never actually checked to see if that singleton was > actually contained in the range, in which case it should return

[PATCH V2] x86: Enable separate shrink wrapping

2025-06-10 Thread Cui, Lili
From: Lili Cui Hi Uros, Thank you very much for providing detailed BKM to reproduce Linux kernel boot failure. My patch and Matz's patch have this problem. We inserted a SUB between TEST and JLE, and the SUB changes the value of EFlags. The branch JLE here went wrong, and a null pointer appe

Re: [PATCH] doc: allow extend.texi to be processed by makeinfo 4.13

2025-06-10 Thread Sandra Loosemore
On 6/9/25 23:56, Jan Beulich wrote: On 06.06.2025 17:28, Sandra Loosemore wrote: On 6/6/25 00:44, Jan Beulich wrote: As per documentation, even 4.7 ought to suffice. At least 4.13 objects to there being nothing ahead of the first comma in @xref{}. --- The text inserted it merely a guess; I'm op

[PATCH] RISC-V: testsuite: fix an obvious build error

2025-06-10 Thread Vineet Gupta
For a non-multilib build, I see following errors. | FAIL: gcc.target/riscv/rvv/vtype-call-clobbered.c (test for excess errors) | Excess errors: | TC-INSTxyz/sysroot/usr/include/gnu/stubs.h:14:11: fatal error: gnu/stubs-lp64.h: No such file or directory compilation terminated. The test selects no

[PATCH] internal-fn: Fix up .POPCOUNT expansion

2025-06-10 Thread Jakub Jelinek
Hi! Apparently my ranger during expansion patch broke bootstrap on aarch64-linux, while building libsupc++, there is endless recursion on __builtin_popcountl (x) == 1 expansion. The hack to temporarily replace SSA_NAME_VAR of the lhs which replaced the earlier hack to temporarily change the gimple

[PATCH] c: fix ICE for invalid code in generic selection [PR120303]

2025-06-10 Thread Martin Uecker
Small fix. Bootstrapped and regression tested for x86_64. Martin c: fix ICE for invalid code in generic selection [PR120303] Fix an error recovery ICE that occurs when a type name can not be parsed correctly in the controlling expression of a generic selection. gc

Re: [PATCH] c: remaining fix for the composite type inconsistency [PR120510]

2025-06-10 Thread Joseph Myers
On Tue, 10 Jun 2025, Martin Uecker wrote: > Here I simply override the type with the one with the prototype. > This is not a perfect replacement for forming the composite type, > but I assume this does not matter for any existing code. But if > you think it is better to keep forming the composite

Re: [PATCH] fortran: add intrinsic doc for trig functions with half-revolutions

2025-06-10 Thread Tobias Burnus
Hi Yuao, Yuao Ma wrote: This patch is a follow-up to commit r16-938-ge8fdd55ec90749. In this patch, we add intrinsic documentation for the newly added trig functions with half-revolutions. We also reorder the documentation for `atand` to place it in correct alphabetical order. When I try to

Re: [PATCH] expand, ranger: Use ranger during expansion [PR120434]

2025-06-10 Thread Jakub Jelinek
On Tue, Jun 10, 2025 at 03:03:27PM -0400, Andrew MacLeod wrote: > Thats perfect, but you arent using the path ranger (thats just threading),so > that latter bit is not neceesary... it'll never trigger where you are in > expand. Ok, here is what I've committed after bootstrap/regtest on x86_64-linu

[committed] testsuite: Add -mpopcnt and -mabm variants of PR90693 tests

2025-06-10 Thread Jakub Jelinek
Hi! My r16-1398 patch broke bootstrap on aarch64-linux and powerpc64le-linux at least. Fixed with r16-1408. The following patch just adds testcases with which the bug can be reproduced also on x86_64-linux where it hasn't been caught by the testsuite (while there are 2 tests with it, both where c

[PATCH] libfortran: Simplify Makefile logic

2025-06-10 Thread FX Coudert
> the patch looks good to me. I only have x86_64, too, therefore I haven't > tested > it (again). There's a lot of repetition in the regenerate.sh file. I hope to > see this "simplified" or rather DRY'ed (Don't repeat yourself - principle) in > the future. Following up on this, here is a new patc

Re: [PATCH] expand, ranger: Use ranger during expansion [PR120434]

2025-06-10 Thread Richard Biener
On Tue, 10 Jun 2025, Jakub Jelinek wrote: > On Mon, Jun 09, 2025 at 07:46:28PM +0200, Jakub Jelinek wrote: > > > So using, say, get_all_dominated_blocks (we free dominators, possibly > > > PHI expansion might insert on edges) to get a PRE ordered set of > > > > I think PHI expansion does insert o

Re: [PATCH] expand, ranger: Use ranger during expansion [PR120434]

2025-06-10 Thread Jakub Jelinek
On Tue, Jun 10, 2025 at 01:05:51PM +0200, Richard Biener wrote: > With your experiment of computing ranges for everything we're good > from the ICE point-of-view. I think there's nothing we can do to > reassure us of correctness, so I'd take Andrews advice here (aka, > go ahead). The only thing w

Re: [PATCH 1/3]middle-end: support vec_cbranch_any and vec_cbranch_all [PR118974]

2025-06-10 Thread Richard Biener
> Am 10.06.2025 um 15:51 schrieb Tamar Christina : > >  >> >> -Original Message- >> From: Richard Biener >> Sent: Tuesday, June 10, 2025 2:12 PM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; Richard Sandiford ; >> nd >> Subject: RE: [PATCH 1/3]middle-end: support vec_cbran

Re: [PATCH] vect: Use combined peeling and versioning for mutually aligned DRs

2025-06-10 Thread Alex Coplan
Hi Pengfei, This looks really good, I've just left a couple of small comments below. On 06/06/2025 14:35, Pengfei Li wrote: > Current GCC uses either peeling or versioning, but not in combination, > to handle unaligned data references (DRs) during vectorization. This > limitation causes some loop

RE: [PATCH 1/3]middle-end: support vec_cbranch_any and vec_cbranch_all [PR118974]

2025-06-10 Thread Richard Biener
On Mon, 9 Jun 2025, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Monday, June 9, 2025 10:30 AM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; Richard Sandiford ; > > nd > > Subject: Re: [PATCH 1/3]middle-end: support vec_cbranch_any and > >

Re: [PATCH] expand, ranger: Use ranger during expansion [PR120434]

2025-06-10 Thread Andrew MacLeod
On 6/10/25 07:10, Jakub Jelinek wrote: On Tue, Jun 10, 2025 at 12:55:39PM +0200, Richard Biener wrote: Yes, it must (but we expand those separately, so we could tear down ranger then). So apart from ICEing I wonder how ranger (and it's cache) deals with basic blocks being added, edges vanishi

Re: [PATCH] expand, ranger: Use ranger during expansion [PR120434]

2025-06-10 Thread Andrew MacLeod
On 6/10/25 10:07, Jakub Jelinek wrote: On Tue, Jun 10, 2025 at 09:59:33AM -0400, Andrew MacLeod wrote: Yes, there are places , particularly fold_using_range in gimple-range-fold.cc,  which expects there to be 2 edges to a GCOND stmt. it always expects 2 successors.   There are not many places

[COMMITTED] Check if constant is a member before returning it.

2025-06-10 Thread Andrew MacLeod
There is a bug in irange::set_range_from_bitmask where if the bitmask indicated the result is a singleton, it would simply return that singleton.  It never actually checked to see if that singleton was actually contained in the range, in which case it should return UNDEFINED. I haven't been ab

[PATCH v2] c++: Optimize dynamic cast to final type by comparing the vptr [PR63164]

2025-06-10 Thread Daniel Bertalan
For final target classes of which the source type is a unique non- virtual base, we know that the dynamic_cast succeeding is equivalent to the vptr pointing to the target's vtable. So check this if possible instead of calling the more expensive `__dynamic_cast` runtime method. This might be extend

Re: [PATCH] powerpc: testsuite: Fix powerpc FMV symbol tests [PR 120519]

2025-06-10 Thread Segher Boessenkool
On Wed, Jun 04, 2025 at 03:47:31PM +, Alfie Richards wrote: > Hi, > > This fixes the FMV powerpc tests I recently committed, and hopefully makes > them > work on a wider range of target configurations. > > I plan to commit this on Monday if no one has any objections. I, the sole maintainer

[COMMITTED] RISC-V: testsuite: fix an obvious build error

2025-06-10 Thread Vineet Gupta
For a non-multilib build, I see following errors. | FAIL: gcc.target/riscv/rvv/vtype-call-clobbered.c (test for excess errors) | Excess errors: | TC-INSTxyz/sysroot/usr/include/gnu/stubs.h:14:11: fatal error: gnu/stubs-lp64.h: No such file or directory compilation terminated. The test selects no

Re: [wwwdocs] Add C status page (C11 table)

2025-06-10 Thread Joseph Myers
On Tue, 10 Jun 2025, Marek Polacek wrote: > + > +Anonymous structures and unions > + href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1406.pdf";>N1406 > +4.6 > + > + 4.6 is probably a reasonable version to list here given that a significant piece (support for designato

[PATCH V5] RISC-V: Prevent speculative vsetvl insn scheduling

2025-06-10 Thread Edwin Lu
The instruction scheduler appears to be speculatively hoisting vsetvl insns outside of their basic block without checking for data dependencies. This resulted in a situation where the following occurs vsetvli a5,a1,e32,m1,tu,ma vle32.v v2,0(a0) sub a1,a1,a5 <-- a1 poten

Re: [PATCH V5] RISC-V: Prevent speculative vsetvl insn scheduling

2025-06-10 Thread Vineet Gupta
On 6/10/25 13:35, Edwin Lu wrote: > The instruction scheduler appears to be speculatively hoisting vsetvl > insns outside of their basic block without checking for data > dependencies. This resulted in a situation where the following occurs > > vsetvli a5,a1,e32,m1,tu,ma > vle32.

Re: [PATCH 03/14] aarch64: Relaxed SEL combiner patterns for unpacked SVE FP conversions

2025-06-10 Thread Richard Sandiford
Spencer Abson writes: > On Mon, Jun 09, 2025 at 02:48:58PM +0100, Richard Sandiford wrote: >> Spencer Abson writes: >> > On Thu, Jun 05, 2025 at 09:24:27PM +0100, Richard Sandiford wrote: >> >> Spencer Abson writes: >> >> > diff --git >> >> > a/gcc/testsuite/gcc.target/aarch64/sve/unpacked_cond

Re: Gimple lowering question

2025-06-10 Thread Richard Biener
> Am 10.06.2025 um 22:18 schrieb Andrew MacLeod : > >  > I had a question asked of me, and now I'm passing the buck. > > extern void *memcpy(void *, const void *, unsigned int); > extern int memcmp(const void *, const void *, unsigned int); > typedef unsigned long bits32; > typedef unsigned ch

Re: [PATCH] internal-fn: Fix up .POPCOUNT expansion

2025-06-10 Thread Richard Biener
> Am 11.06.2025 um 00:33 schrieb Jakub Jelinek : > > Hi! > > Apparently my ranger during expansion patch broke bootstrap on > aarch64-linux, while building libsupc++, there is endless recursion > on __builtin_popcountl (x) == 1 expansion. > The hack to temporarily replace SSA_NAME_VAR of the

[PATCH] libstdc++: Remove outdated comment about wchar_t in create_testsuite_files

2025-06-10 Thread Jonathan Wakely
This script claims that wchar_t tests are filtered out if the toolchain being tested doesn't support it. That doesn't seem to have been true since r0-68039-ga72c74a1dee345 in 2005. libstdc++-v3/ChangeLog: * scripts/create_testsuite_files: Remove incorrect comment about filtering

Re: [RFC PATCH v1 12/31] LoongArch: Forbid k, ZC constraints for movsi_internal

2025-06-10 Thread Xi Ruoyao
On Tue, 2025-06-10 at 16:55 +0800, mengqinggang wrote: > Add a new movsi_internal_la32 similar to movsi_internal, change > constraint w(m, k, ZC) to m. "w" is defined as TARGET_MEM_CONSTRAINT, and per GCC Internal: -- Macro: TARGET_MEM_CONSTRAINT A single character to be used instead of the defau

Re: [PATCH] gcc: Make int n_infiles local to gcc.cc.

2025-06-10 Thread Richard Biener
On Tue, Jun 10, 2025 at 1:19 AM Robert Dubner wrote: > > In the course of stamping out cppcheck warnings, we ran across a complaint > about a "shadowed variable." > > It turns out that a variable declared in gcc/gcc/h as "extern int > n_infiles;" is used only locally in gcc/gcc/cc. > > This change

  1   2   >