Re: [PATCH] tree-ssa-dce: Punt on allocations with too large constant sizes [PR118224]

2025-01-03 Thread Richard Biener
> Am 03.01.2025 um 22:48 schrieb Jakub Jelinek : > > Hi! > > As suggested by Richi in the PR, the following patch will fail to DCE > allocation calls if they have constant size which is too large (over > PTRDIFF_MAX), or for the case of calloc, if either of the arguments > is too large (in th

[COMMITTED] testsuite: Replace MMIX-specific adjustments with TARGET_CALLEE_COPIES-adjustments

2025-01-03 Thread Hans-Peter Nilsson
Also tested that the pattern also matches a TARGET_CALLEE_COPIES-false target. -- >8 -- With the dump now emitting "privatized symbols" in the default "%s.%lu" format also for MMIX, there's still a difference for MMIX. This time it's because numbers have changed (copies introduced before this poin

[COMMITTED] MMIX: Replace format for private symbol output by output-time adjustment

2025-01-03 Thread Hans-Peter Nilsson
All this started with belated MMIX regression patrol in observance of the holidays, looking at gcc.dg/Wstringop-overflow-27.c as a regression for target mmix. That's because of a single message not matched, where there is "note: destination object 'vla::22'" instead of the expected "note: destinat

Re: [PATCH] Fortran: Cray pointer comparison wrongly optimized away [PR106692]

2025-01-03 Thread Harald Anlauf
Hi Jerry! Am 03.01.25 um 05:21 schrieb Jerry D: On 1/2/25 12:04 PM, Harald Anlauf wrote: Dear all, this patch addresses overeager optimization of Cray pointers when used in comparisons.  Cray pointers are non-standard, and odd in a sense that they were introduced before modern Fortran pointers

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-01-03 Thread Lewis Hyatt
On Fri, Jan 03, 2025 at 05:48:12PM +, Matthew Malcomson wrote: > On 1/3/25 17:14, Joseph Myers wrote: > > Does this patch cover everything dealt with by > > > > ([PATCH] testsuite: libitm: Remove build directory path from tes

[PATCH] c++: Honor complain in cp_build_function_call_vec for check_function_arguments warnings [PR117825]

2025-01-03 Thread Jakub Jelinek
Hi! The following testcase ICEs due to re-entering diagnostics. When diagnosing -Wformat-security warning, we try to print instantiation context, which calls tsubst with tf_none, but that in the end calls cp_build_function_call_vec which calls check_function_arguments which diagnoses another warni

[PATCH] tree-ssa-dce: Punt on allocations with too large constant sizes [PR118224]

2025-01-03 Thread Jakub Jelinek
Hi! As suggested by Richi in the PR, the following patch will fail to DCE allocation calls if they have constant size which is too large (over PTRDIFF_MAX), or for the case of calloc, if either of the arguments is too large (in that case in theory the call could succeed if the other argument is va

[PATCH v3] Add new warning Wmissing-designated-initializers [PR39589]

2025-01-03 Thread Peter Frost
v3 Patch: * adds documentation * fixes formatting * minor code cleanup Currently the behaviour of Wmissing-field-initializers is inconsistent between C and C++. The C warning assumes that missing designated initializers are deliberate, and does not warn. The C++ warning doe

[PATCH] c++: Reinstate check for uninitialized bases with c++ <= 17 [PR118239]

2025-01-03 Thread Simon Martin
We currently accept this code with c++ <= 17 even though it's invalid since the base is not initialized (we properly reject it with c++ >= 20) === cut here === struct NoMut1 { int a, b; }; struct NoMut3 : NoMut1 { constexpr NoMut3(int a, int b) {} }; void mutable_subobjects() { constexpr NoMut

Re: [PATCH] COBOL 1/8 hdr: header files

2025-01-03 Thread Jakub Jelinek
On Fri, Jan 03, 2025 at 12:03:06PM -0600, Robert Dubner wrote: > > As has been noted, wide_int can be used for large integer arithmetic > > within the compiler. > > My needs are modest; we use __int128 in only a few places in the host > code. If __int128 were supported by 32-bit GCC, we'd would

Re: [RFA] [PR rtl-optimization/107455] Eliminate unnecessary constant load

2025-01-03 Thread Richard Sandiford
Jeff Law writes: > This resurrects a patch from a bit over 2 years ago that I never wrapped > up. IIRC, I ended up up catching covid, then in the hospital for an > unrelated issue and it just got dropped on the floor in the insanity. > > The basic idea here is to help postreload-cse eliminate m

RE: [PATCH] COBOL 1/8 hdr: header files

2025-01-03 Thread Robert Dubner
> -Original Message- > From: Joseph Myers > Sent: Thursday, January 2, 2025 14:21 > To: Robert Dubner > Cc: James K. Lowden ; gcc-patches@gcc.gnu.org > Subject: RE: [PATCH] COBOL 1/8 hdr: header files > > On Thu, 19 Dec 2024, Robert Dubner wrote: > > > At compile-time (or on the host

Re: [PATCH v5 04/10] OpenMP: Robustify C front end handling of attribute-syntax pragmas

2025-01-03 Thread Sandra Loosemore
On 1/2/25 11:44, Tobias Burnus wrote: [snip] Otherwise, LGTM. I've pushed the attached version of the patch after making the requested trivial changes and re-testing this piece of the series in isolation. It's independent of parts 1, 2, and 3 which are still pending, but a prerequisite for p

Re: [PATCH]AArch64: Implement four and eight chunk VLA concats [PR118272]

2025-01-03 Thread Richard Sandiford
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Friday, January 3, 2025 10:59 AM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> ; ktkac...@gcc.gnu.org >> Subject: Re: [PATCH]AArch64: Implement four and eight chunk VLA con

Re: [PATCH 1/2] testsuite: add testcase for fixed PR117546

2025-01-03 Thread Sam James
Sam James writes: > PR117546 was fixed by Eric's r14-10693-gadab597af288d6 change, but > the testcase here is sufficiently different to be worth including > in torture/. > > gcc/testsuite/ChangeLog: > PR ipa/117546 > * gcc.dg/torture/pr117546.c: New test. > --- Sorry, forgot to ask:

[PATCH 2/2] testsuite: add testcase for fixed PR98000

2025-01-03 Thread Sam James
gcc/testsuite/ChangeLog: PR ipa/98000 * g++.dg/ipa/pr98000.C: New test. --- gcc/testsuite/g++.dg/ipa/pr98000.C | 68 ++ 1 file changed, 68 insertions(+) create mode 100644 gcc/testsuite/g++.dg/ipa/pr98000.C diff --git a/gcc/testsuite/g++.dg/ipa/pr98000

[PATCH 1/2] testsuite: add testcase for fixed PR117546

2025-01-03 Thread Sam James
PR117546 was fixed by Eric's r14-10693-gadab597af288d6 change, but the testcase here is sufficiently different to be worth including in torture/. gcc/testsuite/ChangeLog: PR ipa/117546 * gcc.dg/torture/pr117546.c: New test. --- gcc/testsuite/gcc.dg/torture/pr117546.c | 84

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-01-03 Thread Matthew Malcomson
Ah -- I didn't notice that patch. It looks like both do essentially the same thing. That one identifies the use of the c++ test runner by checking for the presence of the `lang_test_file` variable, and in that case `libitm_target_compile` adds the options, while in my patch the c++ test runne

Re: [RFC/RFA] [PR tree-optimization/92539] Improve code and avoid Warray-bounds false positive

2025-01-03 Thread Qing Zhao
> On Jan 3, 2025, at 11:41, Richard Biener wrote: > > > >> Am 03.01.2025 um 16:22 schrieb Jeff Law : >> >> So this is an implementation of an idea I had a few years back and >> prototyped last spring to fix pr92539. >> >> pr92539 is a false positive Warray-bounds warning triggered by loop

[PATCH] c++/modules: Fix linkage checks for exported using-decls

2025-01-03 Thread xxx
From: yxj-github-437 <2457369...@qq.com> This patch attempts to fix an error when build module std. The reason for the error is __builrin_va_list (aka struct __va_list) is an internal linkage. so attempt to handle this builtin type by identifying whether DECL_SOURCE_LOCATION (entity) is BUILTINS_

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-01-03 Thread Joseph Myers
Does this patch cover everything dealt with by ([PATCH] testsuite: libitm: Remove build directory path from test names), or would some separate fix for that issue still be needed in the presence of this patch? -- Joseph S.

RE: [RFC] PR81358: Enable automatic linking of libatomic

2025-01-03 Thread Joseph Myers
On Fri, 20 Dec 2024, Prathamesh Kulkarni wrote: > Hi, > The previous patch (now reverted) had two different issues both stemming from > the rule added in libatomic/Makefile.am: > (1) As mentioned above, it broke multilib builds because it incorrectly > copies libatomic.a in $(gcc_objdir). The at

Re: [PATCH] testsuite: torture: add LLVM testcase for DSE vs. -ftrivial-auto-var-init=

2025-01-03 Thread Sam James
Mike Stump writes: > On Jan 2, 2025, at 4:00 PM, Sam James wrote: >> >> This testcase came up in a recent LLVM bug report [0] for DSE vs >> -ftrivial-auto-var-init=. Add it to our testsuite given that area >> could do with better coverage. >> >> [0] https://github.com/llvm/llvm-project/issues/

Re: [PATCH] varasm: Fix up array_size_for_constructor RAW_DATA_CST handling once again [PR118275]

2025-01-03 Thread Richard Biener
> Am 03.01.2025 um 09:49 schrieb Jakub Jelinek : > > Hi! > > As the following testcases show (the latter only if I revert the > temporary reversion of the C++ large array speedup), the FEs aren't > really consistent in the type of array CONSTRUCTOR_ELTS indexes, > it can be bitsizetype, but c

Re: [PATCH] forwprop: Use tree_fits_shwi_p in check_ctz_array

2025-01-03 Thread Richard Biener
> Am 03.01.2025 um 09:44 schrieb Jakub Jelinek : > > Hi! > > When touching the function yesterday, I was surprised to see just > TREE_CODE (something) != INTEGER_CST checks followed by tree_to_shwi. > That would ICE if the INTEGER_CST doesn't fit. > > I have actually not been able to reprodu

Re: [PATCH] rtlanal: Treat writes to sp as also writing to memory [PR117938]

2025-01-03 Thread Richard Biener
> Am 03.01.2025 um 10:04 schrieb Richard Sandiford : > > This PR was about a case in which late-combine moved a stack > deallocation across an earlier stack access. This was possible > because the deallocation was missing the RTL-SSA equivalent of > a vop, which in turn was because rtl_proper

Re: [RFC/RFA] [PR tree-optimization/92539] Improve code and avoid Warray-bounds false positive

2025-01-03 Thread Richard Biener
> Am 03.01.2025 um 16:22 schrieb Jeff Law : > > So this is an implementation of an idea I had a few years back and > prototyped last spring to fix pr92539. > > pr92539 is a false positive Warray-bounds warning triggered by loop > unrolling. The warning is in code that will never execute, b

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2025-01-03 Thread Sam James
Marc Poulhiès writes: >>> Would it make sense to drop the "Glibc" here? Having "Glibc" means that >>> we end up with glibc specifics in files that are not glibc specific (e.g. >>> a-exetim__posix.adb or s-osinte__linux.ads). Are these particular macros >>> glibc specific? We need these to build w

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2025-01-03 Thread Marc Poulhiès
>> Would it make sense to drop the "Glibc" here? Having "Glibc" means that >> we end up with glibc specifics in files that are not glibc specific (e.g. >> a-exetim__posix.adb or s-osinte__linux.ads). Are these particular macros >> glibc specific? We need these to build with other libc (e.g. musl)

[COMMITTED 28/30] ada: Rely on default parameter when making component definition nodes

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek When calling Make_Component_Definition we can rely on the default value of parameter Aliased_Present being False. This makes code cleaner and consistent with relying on the default value of other parameters of this routine, e.g. Null_Exclusion_Present. Code cleanup; semantic

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2025-01-03 Thread Sam James
Marc Poulhiès writes: > Hello Nicolas, > >>> At first view, it seems possible and desirable to merge _posix and >>> _rtems, but working on this right now would be counter-productive. >>> >>> I suggest to apply patches 1-2 and fix PR114065 first. >>> >>> Then the cosmetic changes in patches 3-6 (a

[COMMITTED 30/30] ada: Rely on default parameter when making non-null nodes

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek When calling Make_Access_To_Object_Definition and Make_Parameter_Specification we can rely on the default value of parameter Null_Exclusion_Present being False. This makes code cleaner and consistent with relying on the default value of other parameters of this routine. Code

[COMMITTED 23/30] ada: Enclosing_Entity of specless subprogram bodies

2025-01-03 Thread Marc Poulhiès
From: Bob Duff Correct Enclosing_Entity of specless subprogram bodies; these are marked as Comes_From_Source = False, so the simple name was missing. gcc/ada/ChangeLog: * sem_util.adb (Append_Entity_Name): Do not skip the simple name for a compilation unit (which includes

[COMMITTED 26/30] ada: Remove extra checks for raising a constraint error

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Routine Is_OK_Static_Expression itself calls Raises_Constraint_Error, so there is no need to call both of these routines in a row. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_attr.adb (Check_Array_Type): Remove extra call. * sem_util.adb

[COMMITTED 20/30] ada: Fix latent issue exposed by latest change

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou The finalization machinery needs to precisely locate the point where the initialization of objects is complete in order to generate the attachment to the finalization master. For objects initialized with a built-in-place function call, this is achieved by means of the BIP_Ini

[COMMITTED 22/30] ada: Fix comments and change subtype name in response to review

2025-01-03 Thread Marc Poulhiès
From: Tucker Taft gcc/ada/ChangeLog: * pprint.adb (Expression_Image): Adjust and improve comments to match style recommendations, and change name of subtype from Not_Associative to Non_Associative, in response to code review. Tested on x86_64-pc-linux-gnu, commit

[COMMITTED 11/30] ada: Fix small thinko in previous change

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou Even if the declaration of the conditional object is turned into a renaming during expansion, the conditional object must be finalized when the original object would have been. gcc/ada/ChangeLog: * exp_ch4.adb (Insert_Conditional_Object_Declaration): Create the

[COMMITTED 29/30] ada: Rely on default parameter when making non-constant nodes

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek When calling Make_Access_To_Object_Definition and Make_Object_Declaration we can rely on the default value of parameter Constant_Present being False. This makes code cleaner and consistent with relying on the default value of other parameters of this routine, like Null_Exclus

[COMMITTED 21/30] ada: Add parentheses in expressions involving combinations of and & or

2025-01-03 Thread Marc Poulhiès
From: Tucker Taft In the Expression_Image function, we were not inserting parentheses properly when there was a sequence of and and or operators, even though Ada requires such parentheses to show the correct order of association. gcc/ada/ChangeLog: * pprint.adb (Expression_Image): In lo

[COMMITTED 16/30] ada: Simplify check for No_Coextensions restriction

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Alocator): Move unrelated code out of a declare block. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 4 ++-- 1 file changed, 2 insertions(+),

[COMMITTED 19/30] ada: Refine subtype of a universal arithmetic utility routine

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * uintp.adb (N_Digits): Refine return subtype, since this routine always returns a positive number of digits. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/uintp.adb | 4 ++-- 1 f

[COMMITTED 15/30] ada: Simplify traversal procedures into traversal functions

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Instead of using the generic routine Traverse_Proc to set a global flag when a particular node is found, we can use its underlying routine Traverse_Func and check if traversal has been abandoned. We already used this pattern in a number of places; this patch merely applies it

[COMMITTED 12/30] ada: Improve and correct support for inheritance of nonoverriding aspects

2025-01-03 Thread Marc Poulhiès
From: Gary Dismukes This set of changes fixes various issues with the handling of inheritance of nonoverridable aspects (such as for Aggregate, and the indexing and iterator aspects, among others), plus improves some of the error reporting related to those. The prior implementation incorrectly ha

[COMMITTED 07/30] ada: Fix double free at run time for class-wide allocation

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou The previous change was too aggressive and overlooked a specific case. gcc/ada/ChangeLog: * exp_ch4.adb (Expand_Allocator_Expression): Put back the call to Remove_Side_Effects in the case of a function call, a class-wide designated type and a regular

[COMMITTED 25/30] ada: Reuse and simplify counting the length of various lists

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Use utility routines to compute number of elements in lists of nodes and chains of formal parameters. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_aggr.adb (Others_Check): Reuse List_Length; tune whitespace. * exp_ch3.adb (Constrain_Array)

[COMMITTED 18/30] ada: Reuse existing utility routine to detect attribute Loop_Entry

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * checks.adb (Generate_Index_Checks): Reuse existing utility routine. * sem_ch4.adb (Analyze_Indexed_Component_Form): Likewise. * sem_prag.adb (Analyze_Pragma): Likewise. Tested on x86_64-pc-

[COMMITTED 13/30] ada: Handle C++ exception hierarchies

2025-01-03 Thread Marc Poulhiès
From: Alexandre Oliva This patch introduces support for defining exceptions in Ada with C++'s notion of exception type compatibility, such as handling occurrences of derived types, and obtaining class-wide access to the thrown/raised objects. As a bonus, it adds support for C++ dependent (wrappe

[COMMITTED 05/30] ada: Avoid failing reanalysis of aggregate bounds

2025-01-03 Thread Marc Poulhiès
From: Steve Baird An expression like Some_Package."+" (Arg1, Arg2) is sometimes transformed during expansion into an unqualified call of the form "+" (Arg1, Arg2). This is normally ok, but it means that reanalysis of the expression is likely to fail and must therefore be avoided. Remove code that

[COMMITTED 06/30] ada: Warn on unmodified parameters of expression functions

2025-01-03 Thread Marc Poulhiès
From: Bob Duff If an 'out' or 'in out' parameter is not modified in a function body, we warn. However, the warning was missing when we have an expression function instead of a proper body. This patch enables the warning on expression functions. gcc/ada/ChangeLog: * sem_ch6.adb (Analyze_

[COMMITTED 24/30] ada: Remove guards against empty lists

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek There is no need to guard against calling First on a No_List, in which case the call intentionally returns Empty. Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * contracts.adb (Create_Generic_Contract): Remove calls to Present. * sem_util.adb (No

[COMMITTED 17/30] ada: Simplify uses of the global name buffer

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_dist.adb (Assign_Subprogram_Identifier, Reserve_NamingContext_Methods): Simplify. * osint.adb (Append_Suffix_To_File_Name, Find_File, Get_Directory, Object_File_Name, Strip_Direc

[COMMITTED 10/30] ada: Leave empty parent in an array component of an anonymous access type

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek An itype created for a record component with an anonymous access type has empty parent. However, a similar itype created for an array component has its parent copied from the parent of the array type. The above discrepancy appears to be not needed for the frontend. Also, it

[COMMITTED 04/30] ada: Improve expansion of conditional expressions in object declarations

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou This arranges for conditional expressions in objects declarations to have their expansion delayed when they have a type that cannot be easily copied or copied at all, including limited and controlled types. The ultimate goal is to replace the declaration with a renaming decla

[COMMITTED 27/30] ada: Simplify code for obtaining function entity from a function call

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; behavior is unaffected. gcc/ada/ChangeLog: * sem_ch5.adb (Check_Call): Reuse Get_Called_Entity. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 24 ++-- 1 file changed, 2 insertions(+), 22 deletions(

[COMMITTED 08/30] ada: Do not search executables in current dir by default

2025-01-03 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * adaint.c: change default behaviour of __gnat_locate_exec_on_path * adaint.h: change prototype of __gnat_locate_exec_on_path * libgnat/s-os_lib.adb: pass optional argument in Locate_Exec_On_Path * libgnat/s-os_lib.ads: change sp

[COMMITTED 14/30] ada: Assorted style cleanups

2025-01-03 Thread Marc Poulhiès
From: Piotr Trojanek Whitespace and comment cleanups. gcc/ada/ChangeLog: * sem_attr.adb (Eval_Attribute): Fix comment for attribute Image. * tbuild.adb (Make_SC): Remove extra whitespace. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb | 2 +- gcc

[COMMITTED 03/30] ada: Preliminary work in analysis and expansion of initialized allocators

2025-01-03 Thread Marc Poulhiès
From: Eric Botcazou This makes the expansion of the various cases of initialized allocators more uniform by factoring out common processing as much as possible. This also avoids giving the warning or error for a default-initialized allocator when it is marked with No_Initialization. No function

[COMMITTED 02/30] ada: Remove useless space in ALI P lines

2025-01-03 Thread Marc Poulhiès
From: Ronan Desplanques The generated ALI files are syntactically unchanged. gcc/ada/ChangeLog: * lib-writ.adb (Write_ALI): Remove useless space. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/lib-writ.adb | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc/ada/li

[COMMITTED 09/30] ada: Incompatible conversion on vxworks in socket.c

2025-01-03 Thread Marc Poulhiès
From: Douglas B Rupp In the vxworks section, a conversion between char* and int is attempted, which results in a warning with gcc. However with clang with is an error. Note also on 64bit targets, there's a size mismatch. gcc/ada/ChangeLog: * socket.c [__vxworks]: Change vxw_h_addr type

[COMMITTED 01/30] ada: Fix omissions of ALI P line parameters

2025-01-03 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, the compiler would not report various tasking settings specified in library units when these library units did not use tasking, or when they were predefined. While this behavior was implemented deliberately, that was a long time ago and it proved to be a

Re: [PATCH v11] ada: fix timeval timespec on 32 bits archs with 64 bits time_t [PR114065]

2025-01-03 Thread Marc Poulhiès
Hello Nicolas, >> At first view, it seems possible and desirable to merge _posix and >> _rtems, but working on this right now would be counter-productive. >> >> I suggest to apply patches 1-2 and fix PR114065 first. >> >> Then the cosmetic changes in patches 3-6 (and possibly a trivial >> backport

[RFC/RFA] [PR tree-optimization/92539] Improve code and avoid Warray-bounds false positive

2025-01-03 Thread Jeff Law
So this is an implementation of an idea I had a few years back and prototyped last spring to fix pr92539. pr92539 is a false positive Warray-bounds warning triggered by loop unrolling. The warning is in code that will never execute, but none of the optimizers clean things up well enough or ea

Ping^3 [PATCH] get source line for diagnostic from preprocessed file / PR preprocessor/79106

2025-01-03 Thread Bader, Lucas
Hello and Happy New Year, as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79106 is still open, I wanted to again bump this patch I provided a while back. It was earmarked for gcc-11 in https://gcc.gnu.org/pipermail/gcc-patches/2020-January/539201.html but did not make it into the release. Orig

Re: [PATCH] testsuite: libitm: Adjust how libitm.c++ passes link flags

2025-01-03 Thread Matthew Malcomson
Hi Richard, I had a little bit more of a think about this patch, and have changed my mind on how problematic it is to use ALWAYS_CFLAGS w.r.t. naming. It is already used by the C++ tests. If we're happy to use that name then we don't need to introduce a new save/restore. Another reason I think

Re: [patch, Fortran, doc] Mention generating C prototypes from Fortran

2025-01-03 Thread Sam James
Thomas Koenig writes: > Hello world, > > I noticed that there is no mention of automatically generating > C prototypes and declarations in the relevant section of > the docs, "Interoperability with C". This patch remedies that. > > OK for trunk? > > Best regards > > Thomas > > gcc/fortran/C

Re: [PATCH] Ada: Fix build for dummy s-taprop

2025-01-03 Thread Marc Poulhiès
Thanks, The change is fine. FTR, the original change you're referring to is r11-902-gb68c1670b7d40b. Do you have write access to git? Marc Estevan Castilho writes: > From: "Estevan Castilho (Tevo)" > > --- > gcc/ada/libgnarl/s-taprop__dummy.adb | 11 ++- > 1 file changed, 2 insertio

[patch, Fortran, doc] Mention generating C prototypes from Fortran

2025-01-03 Thread Thomas Koenig
Hello world, I noticed that there is no mention of automatically generating C prototypes and declarations in the relevant section of the docs, "Interoperability with C". This patch remedies that. OK for trunk? Best regards Thomas gcc/fortran/ChangeLog: * gfortran.texi: New su

[COMMITTED] bpf: install a wrapping stdint.h for bpf-none-unknown targets

2025-01-03 Thread Jose E. Marchesi
This patch makes GCC to wrap the host's stdint.h header when operating in the default hosted/non-freestanding mode. It is thus up to the user to provide a suitable standard header unless -ffreestanding gets explicitly passed in the compilation line. A few tests that use stdint.h are adapted to ex

Re: [PATCH] c++: Implement for namespace statics CWG 2867 - Order of initialization for structured bindings [PR115769]

2025-01-03 Thread Jakub Jelinek
On Fri, Jan 03, 2025 at 12:39:08PM +0100, Jakub Jelinek wrote: > Should be all !DECL_NAME (decl) MK_unique? Or just > DECL_DECOMPOSITION_P (decl) && !DECL_NAME (decl)? > Structured bindings can't be redeclared, so I guess they are unique. With --- gcc/cp/module.cc.jj 2025-01-02 11:47:10.367499411

Re: [PATCH] c++/modules: Fallback to ftruncate if posix_fallocate fails [PR115008]

2025-01-03 Thread Nathaniel Shead
On Wed, Jan 01, 2025 at 06:11:07PM -0500, Jason Merrill wrote: > On 12/29/24 4:39 AM, Gerald Pfeifer wrote: > > On Sat, 28 Dec 2024, Jason Merrill wrote: > > > On 12/22/24 5:38 AM, Nathaniel Shead wrote: > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, and also on > > > > x86_64-unknown-f

Re: [PATCH] c++: Implement for namespace statics CWG 2867 - Order of initialization for structured bindings [PR115769]

2025-01-03 Thread Jakub Jelinek
On Thu, Dec 19, 2024 at 11:56:10AM -0500, Jason Merrill wrote: > Looks right. So, I've tried to construct a testcase, but turns out modules.cc just doesn't handle structured bindings at namespace scope at all, so it is premature to try to get the ordering right in it. The first patch contains the

RE: [PATCH]AArch64: Implement four and eight chunk VLA concats [PR118272]

2025-01-03 Thread Tamar Christina
> -Original Message- > From: Richard Sandiford > Sent: Friday, January 3, 2025 10:59 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; ktkac...@gcc.gnu.org > Subject: Re: [PATCH]AArch64: Implement four and eight chunk VLA concats > [PR118272] > > Tamar Chr

Re: [PATCH v4 7/7] OpenMP: update documentation for dispatch and adjust_args

2025-01-03 Thread Paul-Antoine Arras
Committing this last patch in the set as obvious (and approved off list). On 02/10/2024 18:55, Paul-Antoine Arras wrote: libgomp/ChangeLog: * libgomp.texi: --- libgomp/libgomp.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp/

Re: [PATCH]AArch64: Implement four and eight chunk VLA concats [PR118272]

2025-01-03 Thread Richard Sandiford
Tamar Christina writes: >> > >> > How about instead doing something like: >> > >> > worklist.reserve (nelts); >> > for (int i = 0; i < nelts; ++i) >> > worklist.quick_push (force_reg (elem_mode, XVECEXP (vals, 0, i))); >> > >> > while (nelts > 2) >> > { >> > for (int i = 0; i <

RE: [PATCH] i386: Change mnemonics from TCVTROWPS2PBF16[H,L] to TCVTROWPS2BF16[H,L]

2025-01-03 Thread Liu, Hongtao
> -Original Message- > From: Jiang, Haochen > Sent: Friday, January 3, 2025 4:55 PM > To: gcc-patches@gcc.gnu.org > Cc: Liu, Hongtao ; ubiz...@gmail.com > Subject: [PATCH] i386: Change mnemonics from TCVTROWPS2PBF16[H,L] to > TCVTROWPS2BF16[H,L] > > Hi all, > > The mnemonics for TCVTRO

RE: [PATCH]AArch64: Implement four and eight chunk VLA concats [PR118272]

2025-01-03 Thread Tamar Christina
> > > > How about instead doing something like: > > > > worklist.reserve (nelts); > > for (int i = 0; i < nelts; ++i) > > worklist.quick_push (force_reg (elem_mode, XVECEXP (vals, 0, i))); > > > > while (nelts > 2) > > { > > for (int i = 0; i < nelts; i += 2) > > { > >

Re: [PATCH] testsuite: torture: add LLVM testcase for DSE vs. -ftrivial-auto-var-init=

2025-01-03 Thread Mike Stump
On Jan 2, 2025, at 4:00 PM, Sam James wrote: > > This testcase came up in a recent LLVM bug report [0] for DSE vs > -ftrivial-auto-var-init=. Add it to our testsuite given that area > could do with better coverage. > > [0] https://github.com/llvm/llvm-project/issues/119646 > > gcc/testsuite/Cha

[PATCH] rtlanal: Treat writes to sp as also writing to memory [PR117938]

2025-01-03 Thread Richard Sandiford
This PR was about a case in which late-combine moved a stack deallocation across an earlier stack access. This was possible because the deallocation was missing the RTL-SSA equivalent of a vop, which in turn was because rtl_properties didn't treat the deallocation as writing to memory. I think th

[PATCH] i386: Change mnemonics from TCVTROWPS2PBF16[H, L] to TCVTROWPS2BF16[H, L]

2025-01-03 Thread Haochen Jiang
Hi all, The mnemonics for TCVTROWPS2PBF16[H,L] has been changed to TCVTROWPS2BF16[H,L] in ISE056. There will be also some more BF16 mnemonics change upcoming, which will fix the regression in PR118270. Bootstraped and tested on x86_64-pc-linux-gnu. Ok for trunk? Ref: https://cdrdv2.intel.com/v1/

[PATCH] c++: Implement mangling of RAW_DATA_CST [PR118278]

2025-01-03 Thread Jakub Jelinek
Hi! As the following testcases show (mangle80.C only after reversion of the temporary reversion of C++ large array speedup commit), RAW_DATA_CST can be seen during mangling of some templates and we ICE because the mangler doesn't handle it. The following patch handles it and mangles it the same a

[PATCH] varasm: Fix up array_size_for_constructor RAW_DATA_CST handling once again [PR118275]

2025-01-03 Thread Jakub Jelinek
Hi! As the following testcases show (the latter only if I revert the temporary reversion of the C++ large array speedup), the FEs aren't really consistent in the type of array CONSTRUCTOR_ELTS indexes, it can be bitsizetype, but can be sizetype as well. Given that everything else is able to cope w

[PATCH] forwprop: Use tree_fits_shwi_p in check_ctz_array

2025-01-03 Thread Jakub Jelinek
Hi! When touching the function yesterday, I was surprised to see just TREE_CODE (something) != INTEGER_CST checks followed by tree_to_shwi. That would ICE if the INTEGER_CST doesn't fit. I have actually not been able to reproduce an ICE for the elt case as the caller gives up if the precision of