[COMMITTED] ada: Correct System.Win32.LocalFileTimeToFileTime wrapper typo

2024-05-14 Thread Marc Poulhiès
From: Philippe Gil The parameters should be swapped to fit Fileapi.h documentation. BOOL LocalFileTimeToFileTime( [in] const FILETIME *lpLocalFileTime, [out] LPFILETIME lpFileTime ); gcc/ada/ * libgnat/s-win32.ads (LocalFileTimeToFileTime): Swap parameters. Tested o

[COMMITTED] ada: Follow-up adjustment to earlier fix in Build_Allocate_Deallocate_Proc

2024-05-14 Thread Marc Poulhiès
From: Eric Botcazou The profile of the procedure built for an allocation on the secondary stack now includes the alignment parameter, so the parameter can just be forwarded in the call to Allocate_Any_Controlled. gcc/ada/ * exp_util.adb (Build_Allocate_Deallocate_Proc): Pass the alignme

[COMMITTED] ada: Spurious unreferenced warning on selected component

2024-05-14 Thread Marc Poulhiès
From: Justin Squirek This patch fixes an error in the compiler whereby a selected component on the left hand side of an assignment statement may not get marked as referenced - leading to spurious unreferenced warnings on such objects. gcc/ada/ * sem_util.adb (Set_Referenced_Modified): U

[COMMITTED] ada: Fix ghost policy in use for generic instantiation

2024-05-14 Thread Marc Poulhiès
From: Yannick Moy The Ghost assertion policy relevant for analyzing a generic instantiation is the Ghost policy at the point of instantiation, not the one applicable for the generic itself. gcc/ada/ * ghost.adb (Mark_And_Set_Ghost_Instantiation): Fix the current Ghost policy for

[COMMITTED] ada: Fix small inaccuracy in previous change

2024-05-14 Thread Marc Poulhiès
From: Eric Botcazou The call to Build_Allocate_Deallocate_Proc must occur before the special accessibility check for class-wide allocation is generated, because this check comes with cleanup code. gcc/ada/ * exp_ch4.adb (Expand_Allocator_Expression): Move the first call to Build

[COMMITTED] ada: Missing support for consistent assertion policy

2024-05-14 Thread Marc Poulhiès
From: Javier Miranda Add missing support for RM 10.2/5: the region for a pragma Assertion_Policy given as a configuration pragma is the declarative region for the entire compilation unit (or units) to which it applies. gcc/ada/ * sem_ch10.adb (Install_Inherited_Policy_Pragmas): New subp

[COMMITTED] ada: Error in determining accumulator subtype for a reduction expression

2024-05-14 Thread Marc Poulhiès
From: Steve Baird There was an earlier bug in determining the accumulator subtype for a reduction expression in the case where the reducer subprogram is overloaded. The fix for that bug introduced a recently-discovered regression. Redo accumulator subtype computation in order to address this regr

[COMMITTED] ada: Compiler crash or errors on if_expression in container aggregate

2024-05-14 Thread Marc Poulhiès
From: Gary Dismukes The compiler may either crash or incorrectly report errors when a component association in a container aggregate is an if_expression with an elsif part whose dependent expression is a call to a function returning a result that requires finalization. The compiler complains that

[COMMITTED] ada: Rtsfind should not trash state used in analyzing instantiations.

2024-05-14 Thread Marc Poulhiès
From: Steve Baird During analysis of an instantiation, Sem_Ch12 manages formal/actual binding information in package state (see Sem_Ch12.Generic_Renamings_HTable). A call to rtsfind can cause another unit to be loaded and compiled. If this occurs during the analysis of an instantiation, and if th

[COMMITTED] ada: Fix crash with -gnatdJ and -gnatf

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a crash when the compiler emits a warning about an unchecked conversion and -gnatdJ is enabled. gcc/ada/ * sem_ch13.adb (Validate_Unchecked_Conversions): Add node parameters to Error_Msg calls. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Reduce generated code duplication for streaming and Put_Image subprograms

2024-05-14 Thread Marc Poulhiès
From: Steve Baird In the case of an untagged composite type, the compiler does not generate streaming-related subprograms or a Put_Image procedure when the type is declared. Instead, these subprograms are declared "on demand" when a corresponding attribute reference is encountered. In this case,

[COMMITTED] ada: Fix overlap warning suppression

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, some warnings about overlapping actuals were emitted regardless of the Value of Warnsw.Warnings_Package.Warn_On_Overlap. This patch fixes this. gcc/ada/ * sem_warn.adb (Warn_On_Overlapping_Actuals): Stop ignoring warning suppression set

[COMMITTED] ada: Small cleanup about allocators and aggregates

2024-05-14 Thread Marc Poulhiès
From: Eric Botcazou This eliminates a few oddities present in the expander for allocators and aggregates present in allocators: - Convert_Array_Aggr_In_Allocator takes both a Decl and Alloc parameters, and inserts new code before Alloc for records and after Decl for arrays through Conv

[COMMITTED] ada: Better error message for bad general case statements

2024-05-14 Thread Marc Poulhiès
From: Steve Baird If -gnatX0 is specified, we allow case statements with a selector expression of a record or array type, but not of a private type. If the selector expression is of a private type then we should generate an appropriate error message instead of a bugbox. gcc/ada/ * sem_c

[COMMITTED] ada: Follow-up adjustment after fix to Default_Initialize_Object

2024-05-14 Thread Marc Poulhiès
From: Eric Botcazou Now that Default_Initialize_Object honors the No_Initialization flag in all cases, objects of an access type declared without initialization expression can no longer be considered as being automatically initialized to null. gcc/ada/ * exp_ch3.adb (Expand_N_Object_Dec

[COMMITTED] ada: Restore default size for dynamic allocations of discriminated type

2024-05-14 Thread Marc Poulhiès
From: Eric Botcazou The allocation strategy for objects of a discriminated type with defaulted discriminants is not the same when the allocation is dynamic as when it is static (i.e a declaration): in the former case, the compiler allocates the default size whereas, in the latter case, it allocat

[COMMITTED] ada: Minor typo fix in comment

2024-05-14 Thread Marc Poulhiès
gcc/ada/ * sem_util.adb: Typo fix in comment. * exp_aggr.adb: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 +- gcc/ada/sem_util.adb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/a

[COMMITTED] ada: Fix warning indicators in usage string

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, the default status of -gnatw.i and -gnatw.d are reported incorrectly in the usage string used throughout GNAT tools. This patch fixes this. gcc/ada/ * usage.adb (Usage): Fix enabled-by-default indicators. Tested on x86_64-pc-linux-gnu, committ

[COMMITTED] ada: Replace "not Present" tests with "No".

2024-05-14 Thread Marc Poulhiès
From: Steve Baird Fix constructs that were flagged by CodePeer. gcc/ada/ * exp_attr.adb: Replace 6 "not Present" tests with equivalent calls to "No". Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_attr.adb | 12 ++-- 1 file changed, 6 insertions(+), 6 de

[COMMITTED] ada: Fix crash with -gnatdJ and JSON output

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques This patch tweaks the calls made to Errout subprograms to report violations of dependence restrictions, in order fix a crash that occurred with -gnatdJ and -fdiagnostics-format=json. gcc/ada/ * restrict.adb (Violation_Of_No_Dependence): Tweak error report

[COMMITTED] ada: Fix pragma Compile_Time_Error and -gnatdJ crash

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques This patch makes it so the diagnostics coming from occurrences of pragma Compile_Time_Error and Compile_Time_Warning are emitted with a node parameter so they don't cause a crash when -gnatdJ is enabled. gcc/ada/ * errout.ads (Error_Msg): Add node parameter.

[COMMITTED] ada: Fix crash with -gnatdJ and -gnatyz

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques This patch makes it so -gnatyz style checks reports specify a node ID. That is required since those checks are sometimes made during semantic analysis of short-circuit operators, where the Current_Node mechanism that -gnatdJ uses is not operational. Check_Xtra_Parens_Prec

[COMMITTED] ada: Fix typo in diagnostic message

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques A previous change introduced an error in the diagnostic message about overlapping actuals. This commit fixes this. gcc/ada/ * sem_warn.adb (Warn_On_Overlapping_Actuals): Fix typo. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_warn.adb | 2

[COMMITED] MAINTAINERS: Fix an entry using spaces instead of tabs

2024-05-14 Thread Filip Kastl
In the MAINTAINERS file, names and emails are separated by tabs. One of the entries recently added used spaces. This patch corrects this. The check-MAINTAINERS.py script breaks a bit when this happens. This patch also adds warning about this situation into the script. ChangeLog: * MAI

[COMMITTED] ada: Fix pragma Warnings and -gnatD interaction

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques A recent change broke pragma Warnings when -gnatD is enabled in some cases. This patch fixes this by caching more slocs at times when it's known that they haven't been modified by -gnatD. gcc/ada/ * errout.adb (Validate_Specific_Warnings): Adapt to record

[COMMITTED] ada: Decouple attachment from dynamic allocation for controlled objects

2024-05-14 Thread Marc Poulhiès
From: Eric Botcazou This decouples the attachment to the appropriate finalization collection of dynamically allocated objects that need finalization from their allocation. The current implementation immediately attaches them after allocating them, which means that they will be finalized even if

[COMMITTED] ada: Fix crash with -gnatdJ and -gnatw.w

2024-05-14 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a crash when -gnatdJ is enabled and a warning must be emitted about an ineffective pragma Warnings clause. Some modifications are made to the specific warnings machinery so that warnings carry the ID of the pragma node they're about, so the -gnatdJ mechan

[COMMITTED] ada: Follow up fixes for Put_Image/streaming regressions

2024-05-14 Thread Marc Poulhiès
From: Steve Baird A recent change to reduce duplication of compiler-generated Put_Image and streaming subprograms introduced two regressions. One is yet another of the many cases where generating these routines "on demand" (as opposed at the point of the associated type declaration) requires loos

[COMMITTED] ada: Document more details of the implementation of finalization chains

2024-05-14 Thread Marc Poulhiès
From: Eric Botcazou gcc/ada/ * exp_ch7.adb (Finalization Management): Add a short description of the implementation of finalization chains. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch7.adb | 29 + 1 file changed, 29 insert

Re: [x86 SSE] Improve handling of ternlog instructions in i386/sse.md

2024-05-14 Thread Hongtao Liu
On Mon, May 13, 2024 at 5:57 AM Roger Sayle wrote: > > > This patch improves the way that the x86 backend recognizes and > expands AVX512's bitwise ternary logic (vpternlog) instructions. I like the patch. 1 file changed, 25 insertions(+), 1 deletion(-) gcc/config/i386/i386-expand.cc | 26 +++

[COMMITTED] ada: Fix classification of SPARK Boolean aspects

2024-05-14 Thread Marc Poulhiès
From: Piotr Trojanek The implementation of User_Aspect_Definition uses subtype Boolean_Aspects to decide which existing aspects can be used to define old aspects. This subtype didn't include many of the SPARK aspects, notably the Always_Terminates. gcc/ada/ * aspects.ads (Aspect_Id, Boo

[PATCH wwwdocs] gcc-14/changes: Add Rust section to New languages

2024-05-14 Thread Arthur Cohen
--- htdocs/gcc-14/changes.html | 13 + 1 file changed, 13 insertions(+) diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 924e045a..dd3fea8d 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -626,6 +626,19 @@ You may also want to chec

Re: [PATCH 2/13] rs6000, Remove __builtin_vsx_xvcvspsxws built-in

2024-05-14 Thread Kewen.Lin
Hi, on 2024/4/20 05:17, Carl Love wrote: > rs6000, Remove __builtin_vsx_xvcvspsxws built-in > > The built-in __builtin_vsx_xvcvspsxws is a duplicate of the vec_signed > built-in that is documented in the PVIPR. The __builtin_vsx_xvcvspsxws > built-in is not documented and there are no test cases

Re: [PATCH] MATCH: Maybe expand (T)(A + C1) * C2 and (T)(A + C1) * C2 + C3 [PR109393]

2024-05-14 Thread Manolis Tsamis
New patch with the requested changes can be found below. I don't know how much this affects SCEV, but I do believe that we should incorporate this change somehow. I've seen various cases of suboptimal address calculation codegen that boil down to this. gcc/match.pd | 31 ++

[PATCH] x86: Add 3-instruction subroutine vector shift for V16QI in ix86_expand_vec_perm_const_1 [PR107563]

2024-05-14 Thread Levy Hsu
Hi All We've introduced a new subroutine in ix86_expand_vec_perm_const_1 to optimize vector shifting for the V16QI type on x86. This patch uses a three-instruction sequence psrlw, psllw, and por to handle specific vector shuffle operations more efficiently. The change aims to improve assembly code

Re: [PATCH] report message for operator %a on unaddressible exp

2024-05-14 Thread Segher Boessenkool
On Tue, May 14, 2024 at 11:00:38AM +0800, Jiufu Guo wrote: > >> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc > >> index 117999613d8..50943d76f79 100644 > >> --- a/gcc/config/rs6000/rs6000.cc > >> +++ b/gcc/config/rs6000/rs6000.cc > >> @@ -14659,6 +14659,12 @@ print_operand

Re: [COMMITED] MAINTAINERS: Fix an entry using spaces instead of tabs

2024-05-14 Thread Xiao Zeng
2024-05-14 16:37  Filip Kastl wrote: > >In the MAINTAINERS file, names and emails are separated by tabs.  One of >the entries recently added used spaces.  This patch corrects this. Thanks. > >The check-MAINTAINERS.py script breaks a bit when this happens.  This >patch also adds warning about thi

Re: [PATCH] report message for operator %a on unaddressible exp

2024-05-14 Thread Segher Boessenkool
Oh, btw: On Tue, May 14, 2024 at 11:00:38AM +0800, Jiufu Guo wrote: > >> --- a/gcc/config/rs6000/rs6000.cc > >> +++ b/gcc/config/rs6000/rs6000.cc > >> @@ -14659,6 +14659,12 @@ print_operand_address (FILE *file, rtx x) > >>else if (SYMBOL_REF_P (x) || GET_CODE (x) == CONST > >> || GET_COD

[PATCH] tree-optimization/99954 - redo loop distribution memcpy recognition fix

2024-05-14 Thread Richard Biener
The following revisits the fix for PR99954 which was observed as causing missed memcpy recognition and instead using memmove for non-aliasing copies. While the original fix mitigated bogus recognition of memcpy the root cause was not properly identified. The root cause is dr_analyze_indices "fail

[committed] libstdc++: Fix typo in std::stacktrace::max_size [PR115063]

2024-05-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk, gcc14 and gcc-13. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/115063 * include/std/stacktrace (basic_stacktrace::max_size): Fix typo in reference to _M_alloc member. * testsuite/19_diagnostics/stacktrace/stacktrace.cc: Check

Re: [PATCH] report message for operator %a on unaddressible exp

2024-05-14 Thread Jiufu Guo
Hi, Segher Boessenkool writes: > On Tue, May 14, 2024 at 11:00:38AM +0800, Jiufu Guo wrote: >> >> diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc >> >> index 117999613d8..50943d76f79 100644 >> >> --- a/gcc/config/rs6000/rs6000.cc >> >> +++ b/gcc/config/rs6000/rs6000.cc >>

Test mail

2024-05-14 Thread Ajit Agarwal

test mail

2024-05-14 Thread Ajit Agarwal

Re: [PATCH] report message for operator %a on unaddressible exp

2024-05-14 Thread Segher Boessenkool
On Tue, May 14, 2024 at 05:53:56PM +0800, Jiufu Guo wrote: > Thanks so much for your great review! > Reference other messages, I'm wondering "invalid %%a value" may be > acceptable, or "invalid %%a address expression in TOC" maybe better. "%%a requires a memory operand"? Maybe even print out the

[Patch, aarch64] v4: Preparatory patch to place target independent and,dependent changed code in one file

2024-05-14 Thread Ajit Agarwal
Hello Alex/Richard: All comments are addressed. There were some issues in sending the patch sending it again. Common infrastructure of load store pair fusion is divided into target independent and target dependent changed code. Target independent code is the Generic code with pure virtual funct

Avoid TYPE_MAIN_VARIANT compares in TBAA

2024-05-14 Thread Jan Hubicka
Hi, while building more testcases for ipa-icf I noticed that there are two places in aliasing code where we still compare TYPE_MAIN_VARIANT for pointer equality. This is not good idea for LTO since type merging may not happen for example when in one unit pointed to type is forward declared while in

[PING] [PATCH v2] testsuite: Verify r0-r3 are extended with CMSE

2024-05-14 Thread Torbjorn SVENSSON
Hi, I'm not sure if the previous "ok" from Richard on the v1 is enough for this or if there needs another approval. Adding extra maintainers since Richard Earnshaw appears to be busy the past weeks. Kind regards, Torbjörn On 2024-05-06 13:50, Torbjorn SVENSSON wrote: Hi, Forgot to mentio

[Patch, aarch64] v4: Preparatory patch to place target independent and,dependent changed code in one file

2024-05-14 Thread Ajit Agarwal
Hello Alex/Richard: All comments are addressed. Common infrastructure of load store pair fusion is divided into target independent and target dependent changed code. Target independent code is the Generic code with pure virtual function to interface betwwen target independent and dependent code.

Re: Fwd: [PATCH 2/7 v2] lto: Remove random_seed from section name.

2024-05-14 Thread Jan Hubicka
> This patch removes suffixes from section names during LTO linking. > > These suffixes were originally added for ld -r to work (PR lto/44992). > They were added to all LTO object files, but are only useful before WPA. > After that they waste space, and if kept random, make LTO caching > impossibl

[PATCH] [debug] Fix dwarf v4 .debug_macro.dwo

2024-05-14 Thread Tom de Vries
Consider a hello world, compiled with -gsplit-dwarf and dwarf version 4, and -g3: ... $ gcc -gdwarf-4 -gsplit-dwarf /data/vries/hello.c -g3 -save-temps -dA ... In section .debug_macro.dwo, we have: ... .Ldebug_macro0: .value 0x4 # DWARF macro version number .byte 0x2 #

Re: [PATCH] [debug] Fix dwarf v4 .debug_macro.dwo

2024-05-14 Thread Jakub Jelinek
On Tue, May 14, 2024 at 01:35:30PM +0200, Tom de Vries wrote: > Consider a hello world, compiled with -gsplit-dwarf and dwarf version 4, and > -g3: > ... > $ gcc -gdwarf-4 -gsplit-dwarf /data/vries/hello.c -g3 -save-temps -dA > ... > > In section .debug_macro.dwo, we have: > ... > .Ldebug_macro0:

Re: [PATCH 4/7] lto: Implement ltrans cache

2024-05-14 Thread Jan Hubicka
> This patch implements Incremental LTO as ltrans cache. > > The cache is active when directory $GCC_LTRANS_CACHE is specified and exists. > Stored are pairs of ltrans input/output files and input file hash. > File locking is used to allow multiple GCC instances to use to same cache. > > Bootstra

[Patch, aarch64] v5: Preparatory patch to place target independent and,dependent changed code in one file

2024-05-14 Thread Ajit Agarwal
Hello Alex/Richard: All review comments are incorporated. Changes since v4: - changed prototype of destructure_pair from rti parameter to pattern parameter. Common infrastructure of load store pair fusion is divided into target independent and target dependent changed code. Target independe

Re: [PATCH v4 0/3] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets

2024-05-14 Thread Manolis Tsamis
Pinging this for GCC15. Thanks On Tue, Apr 23, 2024 at 1:47 PM Manolis Tsamis wrote: > > > noce_convert_multiple_sets has been introduced and extended over time to > handle > if conversion for blocks with multiple sets. Currently this is focused on > register moves and rejects any sort of arith

Re: [PATCH 5/7] lto: Implement cache partitioning

2024-05-14 Thread Jan Hubicka
> gcc/ChangeLog: > > * common.opt: Add cache partitioning. > * flag-types.h (enum lto_partition_model): Likewise. > > gcc/lto/ChangeLog: > > * lto-partition.cc (new_partition): Use new_partition_no_push. > (new_partition_no_push): New. > (free_ltrans_partition): New

Re: [PATCH 7/7] lto: partition specific lto_clone_numbers

2024-05-14 Thread Jan Hubicka
> Replaces "lto_priv.$clone_number" by > "lto_priv.$partition_hash.$partition_specific_clone_number". > To reduce divergence for incremental LTO. > > Bootstrapped/regtested on x86_64-pc-linux-gnu OK, thanks! Honza > > gcc/lto/ChangeLog: > > * lto-partition.cc (set_clone_partition_name_chec

Re: [PATCH 6/7] lto: squash order of symbols in partitions

2024-05-14 Thread Jan Hubicka
> This patch squashes order of symbols in individual partitions, so that > their relative order is conserved, but is not influenced by symbols in > other partitions. > Order of cloned symbols is set to 0. This should be fine because order > specifies order of symbols in input files, which cloned sy

RE: [PATCH] vect: generate suitable convert insn for int -> int, float -> float and int <-> float.

2024-05-14 Thread Richard Biener
On Tue, 14 May 2024, Hu, Lin1 wrote: > Do you have any advice? > > BRs, > Lin > > -Original Message- > From: Hu, Lin1 > Sent: Wednesday, May 8, 2024 9:38 AM > To: gcc-patches@gcc.gnu.org > Cc: Liu, Hongtao ; ubiz...@gmail.com > Subject: [PATCH] vect: generate suitable convert insn for

Re: Avoid TYPE_MAIN_VARIANT compares in TBAA

2024-05-14 Thread Richard Biener
On Tue, 14 May 2024, Jan Hubicka wrote: > Hi, > while building more testcases for ipa-icf I noticed that there are two places > in aliasing code where we still compare TYPE_MAIN_VARIANT for pointer > equality. > This is not good idea for LTO since type merging may not happen for example > when in

[PATCH] testsuite: analyzer: Fix fd-glibc-byte-stream-connection-server.c on Solaris [PR107750]

2024-05-14 Thread Rainer Orth
gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c currently FAILs on Solaris: FAIL: gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c (test for excess errors) Excess errors: /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c:91:3: e

Re: [COMMITTED 2/5] Fix ranger when called from SCEV.

2024-05-14 Thread Richard Biener
On Mon, May 13, 2024 at 8:28 PM Jan-Benedict Glaw wrote: > > On Mon, 2024-05-13 20:19:42 +0200, Jan-Benedict Glaw > wrote: > > On Tue, 2024-04-30 17:24:15 -0400, Andrew MacLeod > > wrote: > > > Bootstrapped on x86_64-pc-linux-gnu with no regressions. pushed. > > > > Starting with this patch (

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-14 Thread Richard Biener
On Mon, 13 May 2024, Qing Zhao wrote: > -Warray-bounds is an important option to enable linux kernal to keep > the array out-of-bound errors out of the source tree. > > However, due to the false positive warnings reported in PR109071 > (-Warray-bounds false positive warnings due to code duplicati

Re: [PATCH v4 1/3] Internal-fn: Support new IFN SAT_ADD for unsigned scalar int

2024-05-14 Thread Richard Biener
On Mon, May 6, 2024 at 4:48 PM wrote: > > From: Pan Li > > This patch would like to add the middle-end presentation for the > saturation add. Aka set the result of add to the max when overflow. > It will take the pattern similar as below. > > SAT_ADD (x, y) => (x + y) | (-(TYPE)((TYPE)(x + y) <

Re: [PATCH v4 2/3] VECT: Support new IFN SAT_ADD for unsigned vector int

2024-05-14 Thread Richard Biener
On Mon, May 6, 2024 at 4:49 PM wrote: > > From: Pan Li > > This patch depends on below scalar enabling patch: > > https://gcc.gnu.org/pipermail/gcc-patches/2024-May/650822.html > > For vectorize, we leverage the existing vect pattern recog to find > the pattern similar to scalar and let the vecto

Re: [r15-429 Regression] FAIL: experimental/simd/pr109261_constexpr_simd.cc -msse2 -O2 -Wno-psabi (test for excess errors) on Linux/x86_64

2024-05-14 Thread Matthias Kretz
Thanks for the report. But I'm unable to reproduce the issue. I'm testing on a Skylake-AVX512 system. I even did a clean rebuild of all of GCC using your configuration (minus your prefix) and still no failure. Could you please send me your libstdc++.log after failing the test? Best, Matthias

Re: Ping [PATCH/RFC] target, hooks: Allow a target to trap on unreachable [PR109267].

2024-05-14 Thread Richard Biener
On Wed, May 8, 2024 at 9:37 PM Iain Sandoe wrote: > > Hi Folks, > > I’d like to land a viable solution to this issue if possible, (it is a show- > stopper for the aarch64-darwin development branch). I was looking as to how we handle __builtin_trap (whether we have an optab for it) - we seem to us

[committed] libstdc++: Document when std::string::shrink_to_fit was added

2024-05-14 Thread Jonathan Wakely
Pushed to trunk. -- >8 -- This section can be misread to say that shrink_to_fit is available from GCC 3.4, but it was added later. libstdc++-v3/ChangeLog: * doc/xml/manual/strings.xml: Clarify that GCC 4.5 added std::string::shrink_to_fit. * doc/html/manual/strings.html:

[PATCH] [testsuite] Fix gcc.dg/pr115066.c fail on aarch64

2024-05-14 Thread Tom de Vries
On aarch64, I get this failure: ... FAIL: gcc.dg/pr115066.c scan-assembler \\.byte\\t0xb\\t# Define macro strx ... This happens because we expect to match: ... .byte 0xb # Define macro strx ... but instead we get: ... .byte 0xb // Define macro strx ... Fix this by not

[PATCH v2] c++: ICE with reference NSDMI [PR114854]

2024-05-14 Thread Marek Polacek
On Thu, May 09, 2024 at 03:47:54PM -0400, Jason Merrill wrote: > On 5/9/24 12:04, Marek Polacek wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we crash on a cp_gimplify_expr/TARGET_EXPR assert: > > > >/* A TARGET_EXPR that expresses direc

[committed] libstdc++: Guard dynamic_cast use in src/c++23/print.cc [PR115015]

2024-05-14 Thread Jonathan Wakely
Tested x86_64-linux, x86_64-w64-mingw32. Pushed to trunk. Backport to gcc-14 to follow. -- >8 -- Do not use dynamic_cast unconditionally, in case libstdc++ is built with -fno-rtti. libstdc++-v3/ChangeLog: PR libstdc++/115015 * src/c++23/print.cc (__open_terminal(streambuf*)) [!_

Re: [PATCH] testsuite: analyzer: Fix fd-glibc-byte-stream-connection-server.c on Solaris [PR107750]

2024-05-14 Thread David Malcolm
On Tue, 2024-05-14 at 14:32 +0200, Rainer Orth wrote: > gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c currently > FAILs > on Solaris: > > FAIL: gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c (test > for excess errors) > > Excess errors: > /vol/gcc/src/hg/master/local/gcc/test

[PING] [contrib] validate_failures.py: fix python 3.12 escape sequence warnings

2024-05-14 Thread Gabi Falk
Hi, This one still needs review: https://inbox.sourceware.org/gcc-patches/20240415233833.104460-1-gabif...@gmx.com/ -- gabi

Re: [PATCH v5 1/5] Improve must tail in RTL backend

2024-05-14 Thread Richard Biener
On Sun, May 5, 2024 at 8:16 PM Andi Kleen wrote: > > - Give error messages for all causes of non sibling call generation > - Don't override choices of other non sibling call checks with > must tail. This causes ICEs. The must tail attribute now only > overrides flag_optimize_sibling_calls locally.

RE: [PATCH v4 1/3] Internal-fn: Support new IFN SAT_ADD for unsigned scalar int

2024-05-14 Thread Li, Pan2
Thanks Richard for comments. > If you require a gassign please statically type your function > argument as gassign * instead and remove this assert. Sure > As addition to Tamars good comments why do you set *cfg_changed_p to > true? You are > not changing the CFG afer all? Yes, we can add it b

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-14 Thread Qing Zhao
> On May 14, 2024, at 09:08, Richard Biener wrote: > > On Mon, 13 May 2024, Qing Zhao wrote: > >> -Warray-bounds is an important option to enable linux kernal to keep >> the array out-of-bound errors out of the source tree. >> >> However, due to the false positive warnings reported in PR10907

Re: [PATCH] [testsuite] Fix gcc.dg/pr115066.c fail on aarch64

2024-05-14 Thread Jakub Jelinek
On Tue, May 14, 2024 at 03:47:46PM +0200, Tom de Vries wrote: > On aarch64, I get this failure: > ... > FAIL: gcc.dg/pr115066.c scan-assembler \\.byte\\t0xb\\t# Define macro strx > ... > > This happens because we expect to match: > ... > .byte 0xb # Define macro strx > ... > but inst

Re: [PATCH] [testsuite] Fix gcc.dg/pr115066.c fail on aarch64

2024-05-14 Thread Jakub Jelinek
On Tue, May 14, 2024 at 03:47:46PM +0200, Tom de Vries wrote: > On aarch64, I get this failure: > ... > FAIL: gcc.dg/pr115066.c scan-assembler \\.byte\\t0xb\\t# Define macro strx > ... > > This happens because we expect to match: > ... > .byte 0xb # Define macro strx > ... > but inst

Re: [PATCH v5 5/5] Add documentation for musttail attribute

2024-05-14 Thread Richard Biener
On Sun, May 5, 2024 at 8:16 PM Andi Kleen wrote: > > gcc/ChangeLog: > > * doc/extend.texi: Document [[musttail]] > --- > gcc/doc/extend.texi | 22 -- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > index e

Re: [PATCH 2/4] libcpp/init: remove unnecessary `struct` keyword

2024-05-14 Thread Richard Biener
On Sat, May 4, 2024 at 5:06 PM Ben Boeckel wrote: > > The initial P1689 patches were written in 2019 and ended up having code > move around over time ended up introducing a `struct` keyword to the > implementation of `cpp_finish`. Remove it to match the rest of the file > and its declaration in th

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-14 Thread Richard Biener
On Tue, 14 May 2024, Qing Zhao wrote: > > > > On May 14, 2024, at 09:08, Richard Biener wrote: > > > > On Mon, 13 May 2024, Qing Zhao wrote: > > > >> -Warray-bounds is an important option to enable linux kernal to keep > >> the array out-of-bound errors out of the source tree. > >> > >> Howe

Re: [PATCH v2 2/2] RISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733]

2024-05-14 Thread Patrick O'Neill
On 5/13/24 20:36, Jeff Law wrote: On 5/13/24 6:54 PM, Patrick O'Neill wrote: On 5/13/24 13:28, Jeff Law wrote: On 5/13/24 12:49 PM, Vineet Gupta wrote: If the constant used for stack offset can be expressed as sum of two S12 values, the constant need not be materialized (in a reg) and

[to-be-committed][RISC-V] Remove redundant AND in shift-add sequence

2024-05-14 Thread Jeff Law
So this patch allows us to eliminate an redundant AND in some shift-add style sequences. I think the testcase was reduced from xz by the RAU team, but I'm not highly confident of that. Specifically the AND is masking off the upper 32 bits of the un-shifted value and there's an outer SIGN_EXT

[PATCH][v2] tree-optimization/99954 - redo loop distribution memcpy recognition fix

2024-05-14 Thread Richard Biener
The following revisits the fix for PR99954 which was observed as causing missed memcpy recognition and instead using memmove for non-aliasing copies. While the original fix mitigated bogus recognition of memcpy the root cause was not properly identified. The root cause is dr_analyze_indices "faili

Re: [PATCH v2 2/2] RISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733]

2024-05-14 Thread Jeff Law
On 5/14/24 8:51 AM, Patrick O'Neill wrote: On 5/13/24 20:36, Jeff Law wrote: On 5/13/24 6:54 PM, Patrick O'Neill wrote: On 5/13/24 13:28, Jeff Law wrote: On 5/13/24 12:49 PM, Vineet Gupta wrote: If the constant used for stack offset can be expressed as sum of two S12 values, the cons

[PATCH 00/12] aarch64: Extend aarch64_feature_flags to 128 bits

2024-05-14 Thread Andrew Carlotti
The end goal of the series is to change the definition of aarch64_feature_flags from a uint64_t typedef to a class with 128 bits of storage. This class uses operator overloading to mimic the existing integer interface as much as possible, but with added restrictions to facilate type checking and e

[PATCH 02/12] aarch64: Move AARCH64_NUM_ISA_MODES definition

2024-05-14 Thread Andrew Carlotti
AARCH64_NUM_ISA_MODES will be used within aarch64-opts.h in a later commit. gcc/ChangeLog: * config/aarch64/aarch64.h (DEF_AARCH64_ISA_MODE): Move to... * config/aarch64/aarch64-opts.h (DEF_AARCH64_ISA_MODE): ...here. diff --git a/gcc/config/aarch64/aarch64-opts.h b/gcc/config/

[PATCH 01/12] aarch64: Remove unused global aarch64_tune_flags

2024-05-14 Thread Andrew Carlotti
gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_tune_flags): Remove unused global variable. (aarch64_override_options_internal): Remove dead assignment. diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 662ff5a9b0c715d0cab0ae4ba63af1b3c

[PATCH 04/12] aarch64: Don't compare aarch64_feature_flags to 0.

2024-05-14 Thread Andrew Carlotti
A later commit will disallow such comparisons. We can instead convert directly to a boolean value, and make sure all such conversions are explicit. TODO: FIX SYSREG GATING. gcc/ChangeLog: * config/aarch64/aarch64-sve-builtins.cc (check_required_extensions): Replace comparison wi

[PATCH 03/12] aarch64: Don't use 0 for aarch64_feature_flags

2024-05-14 Thread Andrew Carlotti
Replace all uses of 0 for aarch64_feature_flags variable initialisation with the (almost) new macro AARCH64_NO_FEATURES. This is needed because a later commit will disallow casts to aarch64_feature_flags from integer types. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc

[PATCH 05/12] aarch64: Eliminate a temporary variable.

2024-05-14 Thread Andrew Carlotti
The name would become misleading in a later commit anyway, and I think this is marginally more readable. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_override_options): Remove temporary variable. diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc i

[PATCH 06/12] aarch64: Introduce aarch64_isa_mode type

2024-05-14 Thread Andrew Carlotti
Currently there are many places where an aarch64_feature_flags variable is used, but only the bottom three isa mode bits are set and read. Using a separate data type for these value makes it more clear that they're not expected or required to have any of their upper feature bits set. It will also

[PATCH 07/12] aarch64: Define aarch64_get_{asm_|}isa_flags

2024-05-14 Thread Andrew Carlotti
Building an aarch64_feature_flags value from data within a gcc_options or cl_target_option struct will get more complicated in a later commit. Use a macro to avoid doing this manually in more than one location. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_hand

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-14 Thread Qing Zhao
> On May 13, 2024, at 20:14, Kees Cook wrote: > > On Tue, May 14, 2024 at 01:38:49AM +0200, Andrew Pinski wrote: >> On Mon, May 13, 2024, 11:41 PM Kees Cook wrote: >>> But it makes no sense to warn about: >>> >>> void sparx5_set (int * ptr, struct nums * sg, int index) >>> { >>> if (index >

[PATCH 08/12] aarch64: Decouple feature flag option storage type

2024-05-14 Thread Andrew Carlotti
The awk scripts that process the .opt files are relatively fragile and only handle a limited set of data types correctly. The unrecognised aarch64_feature_flags type is handled as a uint64_t, which happens to be correct for now. However, that assumption will change when we extend the mask to 128

[PATCH 10/12] aarch64: Add aarch64_feature_flags_from_index macro

2024-05-14 Thread Andrew Carlotti
When aarch64_feature_flags grows to 128 bits, constructing a mask with a specific indexed value set will become more complicated. Extract this operation into a separate macro, and preemptively annotate the feature masks as possibly unused. gcc/ChangeLog: * config/aarch64/aarch64-opts.h

[RFC 11/12] Add explicit bool casts to .md condition users

2024-05-14 Thread Andrew Carlotti
This patch is one way to fix some issues I discovered when disallowing implicit casts to bool from aarch64_feature_flags (in a later patch). That in turn was necessary to prohibit accidental conversion of an aarch64_feature_flags value to an integer by first implicitly casting to a bool (and thus s

[PATCH 09/12] aarch64: Assign flags to local constexpr variable

2024-05-14 Thread Andrew Carlotti
This guarantees that the constant values are actually evaluated at compile time. In previous testing, I have observed GCC failing to evaluate and inline these constant values, which exposed a separate bug in which some of the required symbols from feature_deps were missing. Richard Sandiford has

[PATCH 12/12] aarch64: Extend aarch64_feature_flags to 128 bits

2024-05-14 Thread Andrew Carlotti
Replace the existing typedef with a new class containing two private uint64_t members. Most of the preparatory work was carried out in previous commits. The most notable remaining changes are the addition of the get_isa_mode and with_isa_mode functions for conversion to or from aarch64_isa_mode t

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-14 Thread Jeff Law
On 5/14/24 8:57 AM, Qing Zhao wrote: On May 13, 2024, at 20:14, Kees Cook wrote: On Tue, May 14, 2024 at 01:38:49AM +0200, Andrew Pinski wrote: On Mon, May 13, 2024, 11:41 PM Kees Cook wrote: But it makes no sense to warn about: void sparx5_set (int * ptr, struct nums * sg, int index)

[commited, gcc13] ipa: Compare jump functions in ICF (PR 113907)

2024-05-14 Thread Martin Jambor
Hi, This is a manual backport of r14-9840-g1162861439fd3c from master. Manual because the bits and value range representation in jump functions have changes during the gcc 14 development cycle. In PR 113907 comment #58, Honza found a case where ICF thinks bodies of functions are equivalent but be

  1   2   >