[PATCH] tree-optimization/112344 - relax final value-replacement fix

2023-11-23 Thread Richard Biener
The following tries to reduce the number of cases we use an unsigned type for the addition when we know the original signed increment was OK which is when the total unsigned increment computed fits the signed type as well. This fixes the observed testsuite fallout. Bootstrapped and tested on x86_

Re: [PATCH v5 1/1] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-11-23 Thread waffl3x
> and this in tsubst_lambda_expr that assumes iobj: > > /* Fix the type of 'this'. */ > fntype = build_memfn_type (fntype, type, > type_memfn_quals (fntype), > type_memfn_rqual (fntype)); Unfortunately, putting a condition on this had some unforeseen consequences. I've been working on this about

Re: Re: [PATCH 0/5] Add support for operand-specific alignment requirements

2023-11-23 Thread juzhe.zh...@rivai.ai
Hi, Richard. Here is an example for vsext.vf2. The general pattern for this instruction as follows: (set (operand 0) (unspec:...(operand 1))) We have a TARGET_MIN_VLEN macro which specify minimum VLEN according to -march Consider this case V16QI -> V16HI of vsext.vf2 When TARGET_MIN_VLEN ==

RE: [PATCH V2] RISC-V: Optimize a special case of VLA SLP

2023-11-23 Thread Li, Pan2
Committed, thanks Kito. Pan -Original Message- From: Kito Cheng Sent: Friday, November 24, 2023 2:30 PM To: Juzhe-Zhong Cc: gcc-patches@gcc.gnu.org; kito.ch...@gmail.com; jeffreya...@gmail.com; rdapp@gmail.com Subject: Re: [PATCH V2] RISC-V: Optimize a special case of VLA SLP The

Re: [PATCH V2] RISC-V: Optimize a special case of VLA SLP

2023-11-23 Thread Kito Cheng
The optimization is relatively small, so LGTM, thanks :) On Fri, Nov 24, 2023 at 7:18 AM Juzhe-Zhong wrote: > > When working on fixing bugs of zvl1024b. I notice a special VLA SLP case > can be better optimized. > > v = vec_perm (op1, op2, { nunits - 1, nunits, nunits + 1, ... }) > > Before this

[PATCH] Only allow (int)trunc(x) to (int)x simplification with -ffp-int-builtin-inexact [PR107723]

2023-11-23 Thread Xi Ruoyao
With -fno-fp-int-builtin-inexact, trunc is not allowed to raise FE_INEXACT and it should produce an integral result (if the input is not NaN or Inf). Thus FE_INEXACT should not be raised. But (int)x may raise FE_INEXACT when x is a non-integer, non-NaN, and non-Inf value. C23 recommends to do so

[Committed] RISC-V: Disable BSWAP optimization for NUNITS < 4

2023-11-23 Thread Juzhe-Zhong
When fixing bugs, I notice there is a piece odd codes look incorrect. which probably make codegen worse. #include typedef int8_t vnx2qi __attribute__ ((vector_size (2))); #define MASK_2(X, Y) (Y) - 1 - (X), (Y) - 2 - (X) #define PERMUTE(TYPE, NUNITS)

Re: Re: [PATCH] RISC-V: Optimize a special case of VLA SLP

2023-11-23 Thread 钟居哲
I don't think loop vectorizer can do more optimization here. GCC pass to vec_perm_const targethook vec_perm <,,(nunits - 1, nunits , nuits + 1, )> to handle that. It's very target dependent. We can't do more about that. For RVV, it's better transform this case into vec_extract + vec_shl_inse

Re: [PATCH v3 1/5] LoongArch: Fix usage of LSX and LASX frint/ftint instructions [PR112578]

2023-11-23 Thread Xi Ruoyao
On Thu, 2023-11-23 at 18:03 +, Joseph Myers wrote: > The rint functions indeed don't set errno (don't have domain or range > errors, at least if you ignore the option for signaling NaNs arguments to > be domain errors - which is in TS 18661-1, but not what glibc does, and > not in C23). > >

Re: [PATCH] c++/modules: Support lambdas in static template member initialisers [PR107398]

2023-11-23 Thread Nathaniel Shead
On Thu, Nov 23, 2023 at 11:49:39AM -0500, Nathan Sidwell wrote: > On 11/13/23 06:58, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > > access. > > > > -- >8 -- > > > > The testcase noted in the PR fails because the context of the lambda is > > n

[PATCH] c++: Allow exporting a typedef redeclaration [PR102341]

2023-11-23 Thread Nathaniel Shead
On Thu, Nov 23, 2023 at 11:45:31AM -0500, Nathan Sidwell wrote: > On 11/13/23 01:09, Nathaniel Shead wrote: > > I happened to be browsing the standard a bit later and noticed that we > > incorrectly reject the example given below. > > > > Bootstrapped on x86_64-pc-linux-gnu; regtesting ongoing but

Re: [PATCH] i386: Fix AVX512 and AVX10 option issues

2023-11-23 Thread Hongtao Liu
On Thu, Nov 23, 2023 at 2:10 PM Haochen Jiang wrote: > > Hi all, > > This patch should be able to fix the current issue mentioned in PR112643. > > Also, I fixed some legacy issues in code related to AVX512/AVX10. > > Ok for trunk? Ok > > Thx, > Haochen > > gcc/ChangeLog: > > PR target/1126

Re: [pushed] wwwdocs: *: Remove unused buildstat pages

2023-11-23 Thread Gerald Pfeifer
On Mon, 20 Nov 2023, Thomas Schwinge wrote: >> For GCC 9 to GCC 13 the per-release series buildstat pages have not >> been populated at all, so remove them and reference from the respective >> main release pages. > ACK; I had recently run into such an empty page, and wanted to suggest > the same. >

Re: [PATCH 3/4] c23: aliasing of compatible tagged types

2023-11-23 Thread Joseph Myers
On Thu, 16 Nov 2023, Martin Uecker wrote: > Tell the backend which types are equivalent by setting > TYPE_CANONICAL to one struct in the set of equivalent > structs. Structs are considered equivalent by ignoring > all sizes of arrays nested in types below field level. Is TYPE_CANONICAL *only* use

[COMMITTED] MAINTAINERS: Add myself to write after approval and DCO

2023-11-23 Thread Nathaniel Shead
ChangeLog: * MAINTAINERS: Add myself to write after approval and DCO Signed-off-by: Nathaniel Shead --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b70336761ab..0dbcbadcfd7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -653,6 +653,7

Re: [PATCH 34/44] RISC-V: Provide FP conditional-branch instructions for if-conversion

2023-11-23 Thread Maciej W. Rozycki
On Sun, 19 Nov 2023, Jeff Law wrote: > So this is a more gradual lowering of the FP branches to allow ifcvt to do a > better job. Seems generally reasonable. I don't expect that we're missing > any significant simplifications, though I probably could construct a missed > CSE/GCSE if I worked at

Re: [PATCH 2/4] c23: tag compatibility rules for enums

2023-11-23 Thread Joseph Myers
On Thu, 16 Nov 2023, Martin Uecker wrote: > +enum tt { R = 2 } TT; > +enum tt { > + R = _Generic(&TT, enum tt*: 0, default: 2) > +}; > +// incomplete during construction > + > +enum A { B = 7 } y; > +enum A { B = 7 }; > + > +enum A { B = _Generic(&y, enum A*: 1, default: 7) }; I don't follow

Re: Re: [PATCH] RISC-V: Optimize a special case of VLA SLP

2023-11-23 Thread 钟居哲
Thanks Robin. Send V2: https://gcc.gnu.org/pipermail/gcc-patches/2023-November/638033.html with adding changeLog since I realize changlog issue in V1: gcc/ChangeLog: * config/riscv/riscv-v.cc (shuffle_extract_and_slide1up_patterns): (expand_vec_perm_const_1): Tested on zvl128b/

[PATCH V2] RISC-V: Optimize a special case of VLA SLP

2023-11-23 Thread Juzhe-Zhong
When working on fixing bugs of zvl1024b. I notice a special VLA SLP case can be better optimized. v = vec_perm (op1, op2, { nunits - 1, nunits, nunits + 1, ... }) Before this patch, we are using genriec approach (vrgather): vid vadd.vx vrgather vmsgeu vrgather With this patch, we use vec_extrac

Re: [PATCH 1/4] c23: tag compatibility rules for struct and unions

2023-11-23 Thread Joseph Myers
On Thu, 16 Nov 2023, Martin Uecker wrote: > * c-decl.cc (previous_tag): New function. > (get_parm_info): Turn off warning for C2X. C23 now, not C2X. > (comptypes_internal): Activate comparison of tagged > types (convert_for_assignment): Ingore qualifiers. This still has

Re: [PATCH 33/44] RISC-V: Also allow FP conditions in `riscv_expand_conditional_move'

2023-11-23 Thread Maciej W. Rozycki
On Sun, 19 Nov 2023, Jeff Law wrote: > > Lift this restriction and only bail out if a non-word-mode integer > > condition has been requested, as we cannot handle this specific case > > owing to machine instruction set restriction. We already take care of > > the non-integer, non-floating-point ca

Re: [PATCH 31/44] RISC-V/testsuite: Add branchless cases for generic integer cond adds

2023-11-23 Thread Maciej W. Rozycki
On Sun, 19 Nov 2023, Jeff Law wrote: > > The reason to XFAIL SImode tests for RV64 targets is the compiler thinks > > it has to sign-extend addends, which causes if-conversion to give up. > WRT extension and causing if-conversion to give up. Yes, it's a real issue. > In fact when we had Jivan do

Re: [PATCH 29/44] RISC-V: Add `addMODEcc' implementation for generic targets

2023-11-23 Thread Maciej W. Rozycki
On Sun, 19 Nov 2023, Jeff Law wrote: > Is this an improvement over what if-convert creates for a conditional add or > is the goal to expose the sequence earlier in the pipeline rather than waiting > for ifcvt? TBH I haven't ever seen if-convert eliminate a branch here without this pattern suppl

Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2023-11-23 Thread Antoni Boucher
I will need to not forget to update the function tree_type_to_jit_type in dummy-frontend.cc to add back the support for bfloat16 when the patch for it is merged. On Thu, 2023-11-23 at 17:17 -0500, Antoni Boucher wrote: > Hi. > I did split the patch and sent one for the bfloat16 support and > anoth

Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2023-11-23 Thread Antoni Boucher
Hi. I did split the patch and sent one for the bfloat16 support and another one for the vector support. Here's the updated patch for the machine-dependent builtins. Regards. On Sat, 2023-02-11 at 17:37 -0800, Andrew Pinski wrote: > On Sat, Feb 11, 2023 at 4:31 PM Antoni Boucher via Gcc-patches >

Re: [PATCH 26/44] RISC-V: Add `movMODEcc' implementation for generic targets

2023-11-23 Thread Maciej W. Rozycki
On Sun, 19 Nov 2023, Jeff Law wrote: > OK. Just curious are y'all seeing significant interest in this case from > customers or is this more a case of rounding out the implementation to cover > all potential possibilities? As in the cover letter: we have a case where the pipeline seems to imply

Re: [PATCH] Add support for function attributes and variable attributes

2023-11-23 Thread Antoni Boucher
David: I found back the comment you made. Here it is: I see you have patches to add function and variable attributes; I wonder if this would be cleaner internally if there was a recording::attribute class, rather than the std::pair currently in use (some attributes have int argument

[PATCH] Fortran: avoid obsolescence warning for COMMON with submodule [PR111880]

2023-11-23 Thread Harald Anlauf
Dear all, the PR is about a redundant obsolescence warning for COMMON when a symbols appears in the scope of a submodule. As we did not warn for use-associated symbols, it seemed natural to extend this to symbols that are used in a submodule. Or am I missing anything? Regtests cleanly on x86_64

[PATCH 4/5][_Hashtable] Generalize the small size optimization

2023-11-23 Thread François Dumont
    libstdc++: [_Hashtable] Extend the small size optimization     A number of methods were still not using the small size optimization which     is to prefer an O(N) research to a hash computation as long as N is small.     libstdc++-v3/ChangeLog:     * include/bits/hashtable.h: Mov

[PATCH 5/5][_Hashtable] Prefer to insert after last node

2023-11-23 Thread François Dumont
    libstdc++: [_Hashtable] Prefer to insert after last node     When inserting an element into an empty bucket we currently insert the new node     after the before-begin node so in first position. The drawback of doing this is     that we are forced to update the bucket that was containing th

[PATCH 3/5][_Hashtable] Avoid redundant usage of rehash policy

2023-11-23 Thread François Dumont
    libstdc++: [_Hashtable] Avoid redundant usage of rehash policy     Bypass call to __detail::__distance_fwd and the check if rehash is needed when     assigning an initializer_list to an unordered_multimap or unordered_multiset.     libstdc++-v3/ChangeLog:     * include/bits/hasht

[PATCH 2/5][_Hashtable] Fix implementation inconsistencies

2023-11-23 Thread François Dumont
    libstdc++: [_Hashtable] Fix some implementation inconsistencies     Get rid of the different usages of the mutable keyword. For     _Prime_rehash_policy methods are exported from the library, we need to     keep their const qualifier, so adapt implementation to update previously     mutable

[PATCH 1/5][_Hashtable] Add benches

2023-11-23 Thread François Dumont
libstdc++: [_Hashtable] Enhance/Add performance benches diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert/54075.cc b/libstdc++-v3/testsuite/performance/23_containers/insert/54075.cc index f8fcce31609..f2d975ecdaf 100644 --- a/libstdc++-v3/testsuite/performance/23_containers/in

[PATCH 0/5][_Hashtable] Optimize insertions

2023-11-23 Thread François Dumont
This is a series of patch to enhance _Hashtable insertion operations that I'd like to see in gcc 14. I've already submitted something similar a couple of months ago but it is quite a revisited version. 1/5 Is adding benches to show the impact of the different optimizations 2/5 Implementation i

Re: [PATCH 0/3] A few contrib/regression/btest-gcc.sh updates.

2023-11-23 Thread Geoff Keating
Yes, please take it, I don’t even remember what it does! > On Nov 23, 2023, at 4:02 PM, Jeff Law wrote: > >  > >> On 11/23/23 10:06, Hans-Peter Nilsson wrote: >> Anyone using contrib/regression/btest-gcc.sh besides me? >> It has, besides a copyright update, not seen love and attention in a >>

Re: [PATCH] Add support for function attributes and variable attributes

2023-11-23 Thread Guillaume Gomez
Ping David. :) Le mer. 15 nov. 2023 à 17:56, Antoni Boucher a écrit : > > David: another thing I remember you mentioned when you reviewed an > earlier version of this patch is the usage of `std::pair`. > I can't find where you said that, but I remember you mentioned that we > should use a struct

Re: PR111754

2023-11-23 Thread Richard Sandiford
Prathamesh Kulkarni writes: > On Thu, 26 Oct 2023 at 09:43, Prathamesh Kulkarni > wrote: >> >> On Thu, 26 Oct 2023 at 04:09, Richard Sandiford >> wrote: >> > >> > Prathamesh Kulkarni writes: >> > > On Wed, 25 Oct 2023 at 02:58, Richard Sandiford >> > > wrote: >> > >> So I think the PR could be

[pushed] wwwdocs: conduct: Use licensebuttons.net

2023-11-23 Thread Gerald Pfeifer
i.creativecommons.org now has a permanent redirect for the images we use to licensebuttons.net, so follow that. Pushed. Gerald --- htdocs/conduct-faq.html | 3 ++- htdocs/conduct-report.html | 3 ++- htdocs/conduct-response.html | 3 ++- htdocs/conduct.html | 3 ++- 4 files chang

Re: [PATCH 0/3] A few contrib/regression/btest-gcc.sh updates.

2023-11-23 Thread Jeff Law
On 11/23/23 10:06, Hans-Peter Nilsson wrote: Anyone using contrib/regression/btest-gcc.sh besides me? It has, besides a copyright update, not seen love and attention in a decade. Also, the original author and maintainer hasn't been visibly active with gcc. I've contributed the other trivial

Re: [PATCH v2] ifcvt: Handle multiple rewired regs and refactor noce_convert_multiple_sets

2023-11-23 Thread Richard Sandiford
Manolis Tsamis writes: > The existing implementation of need_cmov_or_rewire and > noce_convert_multiple_sets_1 assumes that sets are either REG or SUBREG. > This commit enchances them so they can handle/rewire arbitrary set statements. > > To do that a new helper struct noce_multiple_sets_info is

[committed] hppa: Fix g++.dg/modules/bad-mapper-1.C on hpux

2023-11-23 Thread John David Anglin
Tested on hppa64-hp-hpux11.11. Committed to trunk. Dave --- hppa: Fix g++.dg/modules/bad-mapper-1.C on hpux 2023-11-23 John David Anglin gcc/testsuite/ChangeLog: * g++.dg/modules/bad-mapper-1.C: Add hppa*-*-hpux* to dg-error "-:failed mapper handshake communication" targets

[committed] hppa: Fix gcc.dg/analyzer/fd-4.c on hpux

2023-11-23 Thread John David Anglin
This fixes gcc.dg/analyzer/fd-4.c on hppa64-hp-hpux11.11. Committed to trunk. Dave --- hppa: Fix gcc.dg/analyzer/fd-4.c on hpux 2023-11-23 John David Anglin gcc/testsuite/ChangeLog: * gcc.dg/analyzer/fd-4.c: Define _MODE_T on hpux. diff --git a/gcc/testsuite/gcc.dg/analyzer/fd-4.c

[committed] hppa: Export main in pr104869.C on hpux

2023-11-23 Thread John David Anglin
This fixes a hpux linker warning about main not being exported. Committed to trunk. Dave --- hppa: Export main in pr104869.C on hpux This is needed to avoid a linker warning. 2023-11-23 John David Anglin gcc/testsuite/ChangeLog: * g++.dg/pr104869.C: Export main on hpux. diff --gi

Re: [PATCH #4/4] testsuite: discard c++ exclusion on underaligned pointer warning

2023-11-23 Thread Mike Stump
On Nov 19, 2023, at 6:34 PM, Alexandre Oliva wrote: > > Having extended check_and_warn_address_or_pointer_of_packed_member to > find the packed (short) enum pointer in the cast expression coming > from the C++ front-end, and amended the C++ front end to mark short > enums as TYPE_PACKED, C++ issu

Re: [PATCH] c++: Check module attachment instead of purview when necessary [PR112631]

2023-11-23 Thread Nathan Sidwell
On 11/20/23 04:47, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write access. -- >8 -- Block-scope declarations of functions or extern values are not allowed when attached to a named module. Similarly, class member functions are not inline if attached t

[committed] hppa: xfail scan-assembler-not check in g++.dg/cpp0x/initlist-const1.C

2023-11-23 Thread John David Anglin
The scan-assembler-not check needs to be xfailed on hppa*-*-hpux*. Dave --- hppa: xfail scan-assembler-not check in g++.dg/cpp0x/initlist-const1.C 2023-11-23 John David Anglin gcc/testsuite/ChangeLog: * g++.dg/cpp0x/initlist-const1.C: xfail scan-assembler-not check on hppa*-

[committed] hppa: Don't skip check for warning at line 411 in Wattributes.c on hppa*64*-*-*

2023-11-23 Thread John David Anglin
The warning is now properly generated. Tested on hppa64-hp-hpux11.11. Committed to trunk. Dave --- Don't skip check for warning at line 411 in Wattributes.c on hppa*64*-*-* 2023-11-23 John David Anglin gcc/testsuite/ChangeLog: * c-c++-common/Wattributes.c: Don't skip check for war

Re: [PATCH 11/44] RISC-V/testsuite: Add branchless cases for integer cond-move operations

2023-11-23 Thread Maciej W. Rozycki
On Sun, 19 Nov 2023, Kito Cheng wrote: > Just one minor comment, I think we don't really need to check rv64 or > rv32 for those compiled without any header file test, but I am fine > with that. We need to set `-march=' differently depending on whether verifying for rv64 or rv32, and then we don

[PATCH] libstdc++: add ARM SVE support to std::experimental::simd

2023-11-23 Thread Srinivas Yadav Singanaboina
libstdc++-v3/ChangeLog: * include/Makefile.am: Add simd_sve.h. * include/Makefile.in: Add simd_sve.h. * include/experimental/bits/simd.h: Add new SveAbi. * include/experimental/bits/simd_builtin.h: Use __no_sve_deduce_t to support existing Neon Abi.

Re: [PATCH 09/44] RISC-V: Rework branch costing model for if-conversion

2023-11-23 Thread Maciej W. Rozycki
On Sun, 19 Nov 2023, Jeff Law wrote: > As I suspect you know a big part of the problem here is that BRANCH_COST and > rtx_cost don't have any common scale and thus trying to compare BRANCH_COST to > RTX_COST doesn't have well defined meaning. We do have preexisting places using COSTS_N_INSNS (BR

Re: [PATCH v3 09/11] c: Turn -Wreturn-mismatch into a permerror

2023-11-23 Thread Florian Weimer
* Marek Polacek: > On Mon, Nov 20, 2023 at 10:56:30AM +0100, Florian Weimer wrote: >> gcc/ >> >> * doc/invoke.texi (Warning Options): Document changes. > > That's pretty vague :). How about "Document that -Wreturn-mismatch is a > permerror in C99."? Applied (with “in C99 and later”). >>

Re: [PATCH 0/5] Add support for operand-specific alignment requirements

2023-11-23 Thread Richard Sandiford
钟居哲 writes: > Hi, Richard. > > Current define_mode_attr can only map an attribute for a mode. > I wonder whether we can map a mode to multiple attributes ? > > E.g. (define_mode_attr dest_constraint [(V16QI "&vr")]) > > But I want it to be: > > (define_mode_attr dest_constraint [(V16QI (TARGET_MIN

Re: [PATCH] testsuite, lib: Re-allow mulitple function start labels.

2023-11-23 Thread Richard Sandiford
Iain Sandoe writes: > Hi > >> On 23 Nov 2023, at 16:11, Christophe Lyon wrote: >> >> Hi Iain, >> >> Thanks for dealing with this :-) >> >> On Thu, 23 Nov 2023 at 10:58, Iain Sandoe wrote: >>> >>> Tested on a cross to armv8l-unknown-linux-gnueabihf where the failing >>> testcase is restored,

[PATCH 0/2] Clean up Valgrind configury

2023-11-23 Thread Alexander Monakov
We have an RFC patch [1] that adds a libgcc wrapper for a Valgrind client request. GCC has autoconf detection for Valgrind in the compiler proper as well as libcpp (where it is actually unnecessary). It's grown rusty, let's clean it up. [1] https://inbox.sourceware.org/gcc-patches/2023102414112

[PATCH 1/2] libcpp: configure: drop unused Valgrind detection

2023-11-23 Thread Alexander Monakov
When top-level configure has either --enable-checking=valgrind or --enable-valgrind-annotations, we want to activate a couple of workarounds in libcpp. They do not use anything from the Valgrind API, so just delete all detection. libcpp/ChangeLog: * config.in: Regenerate. * config

[PATCH 2/2] gcc: configure: drop Valgrind 3.1 compatibility

2023-11-23 Thread Alexander Monakov
Our system.h and configure.ac try to accommodate valgrind-3.1, but it is more than 15 years old at this point. As Valgrind-based checking is a developer-oriented feature, drop the compatibility stuff and streamline the detection. gcc/ChangeLog: * config.in: Regenerate. * configure

[avr,committed] Fix PR86776

2023-11-23 Thread Georg-Johann Lay
AVR was/is not affected by CVE-2017-5753, thus applies as obvious. Johann -- gcc/ PR target/86776 * config/avr/avr.cc (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define to speculation_safe_value_not_needed. diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index c3e

Re: [PATCHv2] Clean up by_pieces_ninsns

2023-11-23 Thread Richard Sandiford
HAO CHEN GUI writes: > Hi, > This patch cleans up by_pieces_ninsns and does following things. > 1. Do the length and alignment adjustment for by pieces compare when > overlap operation is enabled. > 2. Replace unnecessary mov_optab checks with gcc assertions. > > Compared to last version, the

Re: [PATCH v3 1/5] LoongArch: Fix usage of LSX and LASX frint/ftint instructions [PR112578]

2023-11-23 Thread Joseph Myers
On Thu, 23 Nov 2023, Xi Ruoyao wrote: > Indeed... It seems the FE will only generate __builtin_irintf when - > fno-math-errno -funsafe-math-optimizations. > > But I cannot see why this is necessary (at least for us): the rintf > function does not set errno at all, and to me using vftint.w.s here

[committed v2] libstdc++: Define std::ranges::to for C++23 (P1206R7) [PR111055]

2023-11-23 Thread Jonathan Wakely
Here's the finished version of the std::ranges::to patch, which I've pushed to trunk. Tested x86_64-linux. -- >8 -- This adds the std::ranges::to functions for C++23. The rest of P1206R7 is not yet implemented, i.e. the new constructors taking the std::from_range tag, and the new insert_range, a

Re: [PATCH] c++: Clear uninstantiated friend flag when instantiating [PR104234]

2023-11-23 Thread Marek Polacek
On Thu, Nov 23, 2023 at 11:54:48PM +1100, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > access. Based on your great contributions, you should get yourself write access; please follow . I'm not certain the rules

[committed] libstdc++: Fix access error in __gnu_test::uneq_allocator

2023-11-23 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- The operator== function is only a friend of the LHS argument, so cannot access the private member of the RHS argument. Use the public accessor instead. libstdc++-v3/ChangeLog: * testsuite/util/testsuite_allocator.h (uneq_allocator): Fix

Re: [PATCH v5] c-family: Implement __has_feature and __has_extension [PR60512]

2023-11-23 Thread Marek Polacek
On Mon, Nov 20, 2023 at 05:29:58PM -0500, Jason Merrill wrote: > On 11/17/23 09:50, Alex Coplan wrote: > > Hi, > > > > This is a v5 patch to address Marek's feedback here: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-November/635157.html > > > > I also implemented Jason's suggestion to use

Re: [PATCH 0/6] v2 of libdiagnostics

2023-11-23 Thread Pedro Alves
Hi David, On 2023-11-21 22:20, David Malcolm wrote: > Here's v2 of the "libdiagnostics" shared library idea; see: > https://gcc.gnu.org/wiki/libdiagnostics > > As in v1, patch 1 (for GCC) shows libdiagnostic.h (the public > header file), along with examples of simple self-contained programs tha

Re: [PATCH v3 09/11] c: Turn -Wreturn-mismatch into a permerror

2023-11-23 Thread Marek Polacek
On Mon, Nov 20, 2023 at 10:56:30AM +0100, Florian Weimer wrote: > gcc/ > > * doc/invoke.texi (Warning Options): Document changes. That's pretty vague :). How about "Document that -Wreturn-mismatch is a permerror in C99."? > gcc/c/ > > PR c/96284 > * c-typeck.cc (c_finish_ret

Re: [PATCH v2] gcov: Fix integer types in gen_counter_update()

2023-11-23 Thread Sebastian Huber
On 23.11.23 09:20, Sebastian Huber wrote: On 23.11.23 09:11, Jiang, Haochen wrote: -Original Message- From: Sebastian Huber Sent: Wednesday, November 22, 2023 10:24 PM To: Christophe Lyon Cc: Jakub Jelinek;gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] gcov: Fix integer types in gen_cou

Re: [PATCH] c++/modules: Allow exporting const-qualified namespace-scope variables [PR99232]

2023-11-23 Thread Nathan Sidwell
On 11/15/23 07:24, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write access. -- >8 -- By [basic.link] p3.2.1, a non-template non-volatile const-qualified variable is not necessarily internal linkage in a module declaration, and rather may have module l

Re: [PATCH] c++: Clear uninstantiated friend flag when instantiating [PR104234]

2023-11-23 Thread Patrick Palka
On Thu, 23 Nov 2023, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write > access. > > -- >8 -- > > Otherwise attempting to get the originating module declaration ICEs > because the DECL_CHAIN of an instantiated friend template is no longer > its contex

Re: [PATCH] c++/modules: Restrict partitions when parsing import declarations [PR110808]

2023-11-23 Thread Nathan Sidwell
On 11/14/23 01:24, Nathaniel Shead wrote: I'll also note that the comments above the parsing functions here no longer exactly match with the grammar in the standard, should they be updated as well? please. Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write access. -- >8 -

[PATCH 3/3] contrib/regression/btest-gcc.sh: Optionally handle XPASS.

2023-11-23 Thread Hans-Peter Nilsson
Somewhat trivial, still tested on several runs (for cris-elf): two starting from the same state, with/without --handle-xpass-as-fail; the one "without" showing no change in state compared to an unpatched baseline (with the same input-state), and the one with --handle-xpass-as-fail some XPASSing tes

Re: [PATCH 02/11] rtl-ssa: Add some helpers for removing accesses

2023-11-23 Thread Richard Sandiford
Alex Coplan writes: > On 21/11/2023 16:49, Richard Sandiford wrote: >> Richard Sandiford writes: >> > Alex Coplan writes: >> >> This adds some helpers to access-utils.h for removing accesses from an >> >> access_array. This is needed by the upcoming aarch64 load/store pair >> >> fusion pass. >>

[PATCH 2/3] contrib/regression/btest-gcc.sh: Simplify option handling.

2023-11-23 Thread Hans-Peter Nilsson
Tested as with the previous patch. -- >8 -- * btest-gcc.sh (Option handling): Break out shifts from each option alternative. --- contrib/regression/btest-gcc.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/regression/btest-gcc.sh b/contrib/regre

Re: [PATCH v2 1/11] rtl-ssa: Support for inserting new insns

2023-11-23 Thread Richard Sandiford
Alex Coplan writes: > Hi, > > This is a v2, original patch is here: > https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637606.html > > This addresses review feedback and: > - Fixes a bug in the previous version in >function_info::finalize_new_accesses; we should now correctly handle >

[PATCH 1/3] contrib/regression/btest-gcc.sh: Handle multiple options.

2023-11-23 Thread Hans-Peter Nilsson
Deliberately not using getopt. Tested by adding a line right after this code echoing $dashj, $add_passes_despite_regression, and $1 (then exit) and checking that I got it right for combinations of -j j4 --add-passes-despite-regression. -- >8 -- This is a long-standing bug: passing "-j --add-passe

Re: [PATCH 02/11] rtl-ssa: Add some helpers for removing accesses

2023-11-23 Thread Alex Coplan
On 21/11/2023 16:49, Richard Sandiford wrote: > Richard Sandiford writes: > > Alex Coplan writes: > >> This adds some helpers to access-utils.h for removing accesses from an > >> access_array. This is needed by the upcoming aarch64 load/store pair > >> fusion pass. > >> > >> Bootstrapped/regtest

[PATCH 0/3] A few contrib/regression/btest-gcc.sh updates.

2023-11-23 Thread Hans-Peter Nilsson
Anyone using contrib/regression/btest-gcc.sh besides me? It has, besides a copyright update, not seen love and attention in a decade. Also, the original author and maintainer hasn't been visibly active with gcc. I've contributed the other trivial, non-date changes since 2009 and some others befo

Ping: [PATCH] Fix PR112419 (was: [PATCH] Reduce false positives for -Wnonnull for VLA parameters [PR98541])

2023-11-23 Thread Hans-Peter Nilsson
> From: Hans-Peter Nilsson > Date: Thu, 16 Nov 2023 05:24:06 +0100 > > > From: Martin Uecker > > Date: Tue, 07 Nov 2023 06:56:25 +0100 > > > Am Montag, dem 06.11.2023 um 21:01 -0700 schrieb Jeff Law: > > > > > > On 11/6/23 20:58, Hans-Peter Nilsson wrote: > > > > This patch caused a testsuite

Re: [PATCH v5] gcc: Introduce -fhardened

2023-11-23 Thread Marek Polacek
On Tue, Nov 21, 2023 at 10:41:10AM -0500, Marek Polacek wrote: > On Mon, Nov 20, 2023 at 05:32:47PM +0100, Jakub Jelinek wrote: > > LGTM. > > Thanks a lot. Since Richi seems to be fine with the patch as well, > I'll push it tomorrow AM if no comments. Pushed. I'll update changes.html now. Than

Re: [PATCH] testsuite, lib: Re-allow mulitple function start labels.

2023-11-23 Thread Christophe Lyon
On Thu, 23 Nov 2023 at 17:35, Iain Sandoe wrote: > > Hi > > > On 23 Nov 2023, at 16:11, Christophe Lyon > > wrote: > > > > Hi Iain, > > > > Thanks for dealing with this :-) > > > > On Thu, 23 Nov 2023 at 10:58, Iain Sandoe wrote: > >> > >> Tested on a cross to armv8l-unknown-linux-gnueabihf whe

Re: [PATCH] c++/modules: Support lambdas in static template member initialisers [PR107398]

2023-11-23 Thread Nathan Sidwell
On 11/13/23 06:58, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write access. -- >8 -- The testcase noted in the PR fails because the context of the lambda is not in namespace scope, but rather in class scope. This patch removes the assertion that the c

Re: [Patch] OpenMP: Accept argument to depobj's destroy clause

2023-11-23 Thread Jakub Jelinek
On Thu, Nov 23, 2023 at 04:59:16PM +0100, Tobias Burnus wrote: > > There is also OEP_LEXICOGRAPHIC which could be used in addition to that. > > The question is if we want to consider say > > #pragma depobj (a[++i]) destroy (a[++i]) > > as same or different (similarly a[foo ()] in both cases). > >

[PATCH v5] c++: implement P2564, consteval needs to propagate up [PR107687]

2023-11-23 Thread Marek Polacek
On Mon, Nov 13, 2023 at 09:06:09PM -0500, Jason Merrill wrote: > On 11/6/23 17:34, Marek Polacek wrote: > > On Fri, Nov 03, 2023 at 01:51:07PM -0400, Jason Merrill wrote: > > > On 11/2/23 11:28, Marek Polacek wrote: > > > > On Sat, Oct 14, 2023 at 12:56:11AM -0400, Jason Merrill wrote: > > > > > On

Re: [PATCH 2/1] c++/modules: Allow exporting a typedef redeclaration

2023-11-23 Thread Nathan Sidwell
On 11/13/23 01:09, Nathaniel Shead wrote: I happened to be browsing the standard a bit later and noticed that we incorrectly reject the example given below. Bootstrapped on x86_64-pc-linux-gnu; regtesting ongoing but modules.exp completed with no errors. -- >8 -- A typedef doesn't create a new

[PATCH v2 1/11] rtl-ssa: Support for inserting new insns

2023-11-23 Thread Alex Coplan
Hi, This is a v2, original patch is here: https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637606.html This addresses review feedback and: - Fixes a bug in the previous version in function_info::finalize_new_accesses; we should now correctly handle the case where properties.refs ()

Re: [PATCH] c++/modules: check mismatching exports for class tags [PR98885]

2023-11-23 Thread Nathan Sidwell
On 11/12/23 07:00, Nathaniel Shead wrote: I think the error message is still a little bit unclear but I couldn't come up with something clearer that was similarly concise and matching the existing style. (Also I noticed that the linked PR was assigned to Nathan but there hadn't been activity for

Re: [PATCH] testsuite, lib: Re-allow mulitple function start labels.

2023-11-23 Thread Iain Sandoe
Hi > On 23 Nov 2023, at 16:11, Christophe Lyon wrote: > > Hi Iain, > > Thanks for dealing with this :-) > > On Thu, 23 Nov 2023 at 10:58, Iain Sandoe wrote: >> >> Tested on a cross to armv8l-unknown-linux-gnueabihf where the failing >> testcase is restored, and on aarch64-linux-gnu where no

Re: [PATCH V2] libgcc: mark __hardcfr_check_fail as always_inline

2023-11-23 Thread Jose E. Marchesi
>> Am 23.11.2023 um 16:17 schrieb Jose E. Marchesi : >> >> [Changes from V1: >> - Use always_inline only in BPF target.] >> >> The function __hardcfr_check_fail in hardcfr.c is internal and static >> inline. It receives many arguments, which require more than five >> registers to be passed in

Re: libstdc++: Turn memmove to memcpy in vector reallocations

2023-11-23 Thread Jonathan Wakely
On Tue, 21 Nov 2023 at 18:11, Marc Glisse wrote: > > On Tue, 21 Nov 2023, Jonathan Wakely wrote: > > > CC Marc Glisse who added the relocation support. He might recall why > > we use memmove when all uses are for newly-allocated storage, which > > cannot overlap the existing storage. > > Going bac

Re: libstdc++: Speed up push_back

2023-11-23 Thread Jonathan Wakely
On Thu, 23 Nov 2023 at 15:44, Jan Hubicka wrote: > > Hi, > so if I understand it right, it should be safe to simply replace memmove > by memcpy. I wonder if we can get rid of the count != 0 check at least > for glibc systems. I don't think we can do that. It's still undefined with glibc, and gli

Re: libstdc++: Speed up push_back

2023-11-23 Thread Jonathan Wakely
On Thu, 23 Nov 2023 at 15:34, Jan Hubicka wrote: > > > > On Sunday, 19 November 2023 22:53:37 CET Jan Hubicka wrote: > > > > Sadly it is really hard to work out this > > > > from IPA passes, since we basically care whether the iterator points to > > > > the same place as the end pointer, which are

Re: [PATCH] AArch64/testsuite: Use non-capturing parentheses with ccmp_1.c

2023-11-23 Thread Maciej W. Rozycki
On Wed, 22 Nov 2023, Richard Earnshaw (lists) wrote: > > Use non-capturing parentheses for the subexpressions used with > > `scan-assembler-times', to avoid a quirk with double-counting. > > > > gcc/testsuite/ > > * gcc.target/aarch64/ccmp_1.c: Use non-capturing parentheses > > with

Re: [PATCH] testsuite, lib: Re-allow mulitple function start labels.

2023-11-23 Thread Christophe Lyon
Hi Iain, Thanks for dealing with this :-) On Thu, 23 Nov 2023 at 10:58, Iain Sandoe wrote: > > Tested on a cross to armv8l-unknown-linux-gnueabihf where the failing > testcase is restored, and on aarch64-linux-gnu where no change is seen > on the aarch64.exp suite. Also tested on arm64 Darwin f

Re: [Patch] OpenMP: Accept argument to depobj's destroy clause

2023-11-23 Thread Tobias Burnus
Hi Jakub, On 23.11.23 16:32, Jakub Jelinek wrote: On Thu, Nov 23, 2023 at 04:21:50PM +0100, Tobias Burnus wrote: @@ -21663,7 +21666,25 @@ c_parser_omp_depobj (c_parser *parser) + else if (depobj != error_mark_node + && !operand_equal_p (destobj, depobj, +

Re: [PATCH 3/6] arm: [MVE intrinsics] Add support for contiguous loads and stores

2023-11-23 Thread Christophe Lyon
Hi! On Thu, 23 Nov 2023 at 14:29, Jan-Benedict Glaw wrote: > > On Thu, 2023-11-16 15:26:14 +, Christophe Lyon > wrote: > > diff --git a/gcc/config/arm/arm-mve-builtins-functions.h > > b/gcc/config/arm/arm-mve-builtins-functions.h > > index eba1f071af0..6d234a2dd7c 100644 > > --- a/gcc/conf

[PATCH] arm: [MVE intrinsics] Add default clause to full_width_access::memory_vector_mode

2023-11-23 Thread Christophe Lyon
My recent commit 0c2037d9d93a8f768cb11698ff794278246bb31f added a switch statement lacking a default clause, leading to warnings or errors when building with --enable-werror-always. Fix by adding an empty default. Committed as obvious. 2023-11-23 Christophe Lyon gcc/ * config

Re: [PATCH V2] libgcc: mark __hardcfr_check_fail as always_inline

2023-11-23 Thread Richard Biener
> Am 23.11.2023 um 16:17 schrieb Jose E. Marchesi : > > [Changes from V1: > - Use always_inline only in BPF target.] > > The function __hardcfr_check_fail in hardcfr.c is internal and static > inline. It receives many arguments, which require more than five > registers to be passed in bpf-no

Re: libstdc++: Speed up push_back

2023-11-23 Thread Jan Hubicka
Hi, so if I understand it right, it should be safe to simply replace memmove by memcpy. I wonder if we can get rid of the count != 0 check at least for glibc systems. In general push_back now need inline-insns-auto to be 33 to be inlined at -O2 jh@ryzen4:/tmp> cat ~/tt.C #include typedef unsig

Re: libstdc++: Speed up push_back

2023-11-23 Thread Jan Hubicka
> > On Sunday, 19 November 2023 22:53:37 CET Jan Hubicka wrote: > > > Sadly it is really hard to work out this > > > from IPA passes, since we basically care whether the iterator points to > > > the same place as the end pointer, which are both passed by reference. > > > This is inter-procedural va

Re: [Patch] OpenMP: Accept argument to depobj's destroy clause

2023-11-23 Thread Jakub Jelinek
On Thu, Nov 23, 2023 at 04:21:50PM +0100, Tobias Burnus wrote: > @@ -21663,7 +21666,25 @@ c_parser_omp_depobj (c_parser *parser) > clause = error_mark_node; > } >else if (!strcmp ("destroy", p)) > - kind = OMP_CLAUSE_DEPEND_LAST; > + { > + matching_parens c_par

[committed] i386: Wrong code with __builtin_parityl [PR112672]

2023-11-23 Thread Uros Bizjak
gen_parityhi2_cmp instruction clobbers its input operand, so use a temporary register in the call to gen_parityhi2_cmp. PR target/112672 gcc/ChangeLog: * config/i386/i386.md (parityhi2): Use temporary register in the call to gen_parityhi2_cmp. gcc/testsuite/ChangeLog: * gcc.tar

  1   2   >