Re: [PATCH] Fortran: reject MODULE PROCEDURE outside generic module interface [PR99036]

2023-03-21 Thread Paul Richard Thomas via Gcc-patches
Hi Harald, This is good for trunk and for backporting. Thanks for the rapid fix. Paul On Mon, 20 Mar 2023 at 20:57, Harald Anlauf via Fortran wrote: > Dear all, > > the attached trivial patch catches a MODULE PROCEDURE outside of a > module interface before we run into an internal error. > >

Re: stor-layout: Set TYPE_TYPELESS_STORAGE consistently for type variants

2023-03-21 Thread Richard Biener via Gcc-patches
On Mon, Mar 20, 2023 at 8:47 PM Joseph Myers wrote: > > I've observed an LTO wrong-code bug with a large testcase in GCC 12, > that results from TYPE_TYPELESS_STORAGE not being set consistently on > type variants. > > Specifically, in the LTO stage of compilation, there is an aggregate > type pass

[PATCH] RISC-V: Fix loss of function to script 'multilib-generator'

2023-03-21 Thread Songhe Zhu
The arch 'rv32imac' will not be created when excuting './multilib-generator rv32imc-ilp32--a' The output is: MULTILIB_OPTIONS = march=rv32imc mabi=ilp32 MULTILIB_DIRNAMES = rv32imc ilp32 MULTILIB_REQUIRED = march=rv32imc/mabi=ilp32 MULTILIB_REUSE = Analysis : The alts:['rv32imc', 'rv32imac'] will

Re: [PATCH] tree-optimization/109170 - bogus use-after-free with __builtin_expect

2023-03-21 Thread Richard Biener via Gcc-patches
On Mon, 20 Mar 2023, Jakub Jelinek wrote: > On Mon, Mar 20, 2023 at 12:12:14PM +, Richard Biener wrote: > > PR tree-optimization/109170 > > * gimple-range-op.cc (cfn_pass_through_arg1): New. > > (gimple_range_op_handler::maybe_builtin_call): Handle > > __builtin_expect and simi

[PATCH] tree: Fix up component_ref_sam_type handling of arrays of 0 sized elements [PR109215]

2023-03-21 Thread Jakub Jelinek via Gcc-patches
Hi! Our documentation sadly talks about elt_type arr[0]; as zero-length arrays, not arrays with zero elements. Unfortunately, those aren't the only arrays which can have zero size, the same size can be also result of zero-length element, like in GNU C struct whatever {} or in GNU C/C++ if the ele

Re: [PATCH] tree-optimization/109170 - bogus use-after-free with __builtin_expect

2023-03-21 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 21, 2023 at 08:21:18AM +, Richard Biener wrote: > On Mon, 20 Mar 2023, Jakub Jelinek wrote: > > > On Mon, Mar 20, 2023 at 12:12:14PM +, Richard Biener wrote: > > > PR tree-optimization/109170 > > > * gimple-range-op.cc (cfn_pass_through_arg1): New. > > > (gimple_range_op_

Re: [PATCH] Fortran: reject MODULE PROCEDURE outside generic module interface [PR99036]

2023-03-21 Thread Tobias Burnus
On 20.03.23 21:57, Harald Anlauf via Gcc-patches wrote: --- a/gcc/fortran/decl.cc +++ b/gcc/fortran/decl.cc @@ -9998,6 +9998,7 @@ gfc_match_modproc (void) if ((gfc_state_stack->state != COMP_INTERFACE && gfc_state_stack->state != COMP_CONTAINS) || gfc_state_stack->previous ==

[PATCH 0/2] Make std::experimental::simd (more) usable with Clang

2023-03-21 Thread Matthias Kretz via Gcc-patches
Up to now, compiling std::experimental::simd with Clang would lead to wrong code, not compiling, or ICEs. After these patches I hope it's only ICEs. Tested on x86_64-pc-linux-gnu. Matthias Kretz (2): libstdc++: Fix simd test compilation with Clang libstdc++: Fix simd compilation with Clang

[PATCH 1/2] libstdc++: Fix simd test compilation with Clang

2023-03-21 Thread Matthias Kretz via Gcc-patches
Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/operators.cc: Clang doesn't define __GCC_IEC_559. Use __STDC_IEC_559__ instead. --- .../testsuite/experimental/simd/tests/operators.cc | 9 - 1 file changed, 8 insertions(+)

[PATCH 2/2] libstdc++: Fix simd compilation with Clang

2023-03-21 Thread Matthias Kretz via Gcc-patches
Clang fails to compile some constant expressions involving simd. Therefore, just disable this non-conforming extension for clang. Fix AVX512 blend implementation for Clang. It was converting the bitmask to bool before, which is obviously wrong. Instead use a Clang builtin to convert the bitmask

Re: [PATCH] tree: Fix up component_ref_sam_type handling of arrays of 0 sized elements [PR109215]

2023-03-21 Thread Richard Biener via Gcc-patches
On Tue, 21 Mar 2023, Jakub Jelinek wrote: > Hi! > > Our documentation sadly talks about elt_type arr[0]; as zero-length arrays, > not arrays with zero elements. Unfortunately, those aren't the only arrays > which can have zero size, the same size can be also result of zero-length > element, like

Re: [PATCH] c++: implement __add_pointer built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
Please disregard this patch. On Mon, Mar 20, 2023 at 12:44 AM Ken Matsui wrote: > This patch implements built-in trait for std::add_pointer. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __add_pointer. > * semantics.cc (finish_trait_type): Handle CPTK_ADD_POINTER. > > gcc/testsuite/ChangeLog:

Re: Ping (gcc/configure.ac, docs): [PATCH v2 4/5] Update texinfo.tex, remove the @gol macro/alias

2023-03-21 Thread Arsen Arsenović via Gcc-patches
Arsen Arsenović via Gcc-patches writes: > Thank you! I'll do a final rebase and push in the morning. Done! Gerald, please update the scripts when you get a chance (but back the old ones up just in case!) If makeinfo is updated as I've asked in one of the other emails, will the script eventua

Re: [PATCHv4, gfortran] Escalate failure when Hollerith constant to real conversion fails [PR103628]

2023-03-21 Thread Tobias Burnus
Hi, LGTM, except for: On 21.03.23 07:29, HAO CHEN GUI wrote: @@ -4708,7 +4710,12 @@ do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e) finish: if (result == &gfc_bad_expr) -return false; +{ + if (errorcount == old_errorcount + && (!gfc_buffered_p () && !gfc_error_f

[PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __add_const. libstdc++-v3/ChangeLog: * include/std/type_traits (add_const): Use __add_const built-in trait. --- libstdc++-v3/include/std/type_traits | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libstdc++-v3/include/std/type_tr

[PATCH 1/2] c++: implement __add_const built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::add_const. gcc/cp/ChangeLog: * cp-trait.def: Define __add_const. * semantics.cc (finish_trait_type): Handle CPTK_ADD_CONST. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __add_const. * g++.d

Re: [PATCH 1/2] libstdc++: Fix simd test compilation with Clang

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 09:24, Matthias Kretz via Libstdc++ < libstd...@gcc.gnu.org> wrote: > > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * testsuite/experimental/simd/tests/operators.cc: Clang doesn't > define __GCC_IEC_559. Use __STDC_IEC_559__ instead. >

Re: [PATCH v4] gcov: Fix "do-while" structure in case statement leads to incorrect code coverage [PR93680]

2023-03-21 Thread Richard Biener via Gcc-patches
On Tue, 14 Mar 2023, Xionghu Luo wrote: > > > On 2023/3/9 20:02, Richard Biener wrote: > > On Wed, 8 Mar 2023, Xionghu Luo wrote: > > > >> > >> > >> On 2023/3/7 19:25, Richard Biener wrote: > > It would be nice to avoid creating blocks / preserving labels we'll > > immediately remove ag

Re: [PATCH 2/2] libstdc++: Fix simd compilation with Clang

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 09:24, Matthias Kretz via Libstdc++ < libstd...@gcc.gnu.org> wrote: > > > Clang fails to compile some constant expressions involving simd. > Therefore, just disable this non-conforming extension for clang. > > Fix AVX512 blend implementation for Clang. It was converting the

Re: [PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Marc Glisse via Gcc-patches
On Tue, 21 Mar 2023, Ken Matsui via Libstdc++ wrote: /// add_const +#if __has_builtin(__add_const) + template +struct add_const +{ using type = __add_const(_Tp); }; +#else template struct add_const { using type = _Tp const; }; +#endif Is that really better? You asked elsew

Re: [PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 11:21, Marc Glisse via Libstdc++ < libstd...@gcc.gnu.org> wrote: > On Tue, 21 Mar 2023, Ken Matsui via Libstdc++ wrote: > > > /// add_const > > +#if __has_builtin(__add_const) > > + template > > +struct add_const > > +{ using type = __add_const(_Tp); }; > > +#else

Re: [PATCH 1/2] c++: implement __add_const built-in trait

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 11:12, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch implements built-in trait for std::add_const. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __add_const. > * semantics.cc (finish_trait_type): Handle CPTK_ADD_CONST. > > gcc/tests

Re: [PATCH 1/2] c++: implement __add_const built-in trait

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 11:26, Jonathan Wakely wrote: > > > On Tue, 21 Mar 2023 at 11:12, Ken Matsui via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> This patch implements built-in trait for std::add_const. >> >> gcc/cp/ChangeLog: >> >> * cp-trait.def: Define __add_const. >> * s

Re: [PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Ken Matsui via Gcc-patches
Thank you for your information. Although it matches my intuition, I sent this patch because I was unsure my intuition was correct. As Jonathan pointed out, there appear to be several implementation errors. The benchmark result for this trait is kind of trivial, so I will implement the other traits

[PATCH V2, rs6000] Tweak modulo define_insns to eliminate register copy

2023-03-21 Thread Pat Haugen via Gcc-patches
Updated patch with review comments addressed: fixed up testcase and added another testcase to verify peephole is functional. Don't force target of modulo into a distinct register. The define_insns for the modulo operation currently force the target register to a distinct reg in preparation for

[PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]

2023-03-21 Thread Jakub Jelinek via Gcc-patches
Hi! As mentioned in the PR, vect-simd-clone-1[678]{,f}.c tests FAIL on x86_64-linux with -m64/-march=cascadelake or -m32/-march=cascadelake, there are 3 matches for the calls rather than expected two. As suggested by Richi, this patch changes those tests to use --param vect-epilogues-nomask=0 such

Re: [PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]

2023-03-21 Thread Richard Biener via Gcc-patches
On Tue, 21 Mar 2023, Jakub Jelinek wrote: > Hi! > > As mentioned in the PR, vect-simd-clone-1[678]{,f}.c tests FAIL on > x86_64-linux with -m64/-march=cascadelake or -m32/-march=cascadelake, > there are 3 matches for the calls rather than expected two. > As suggested by Richi, this patch changes

Re: [PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]

2023-03-21 Thread Andrew Stubbs
On 21/03/2023 12:14, Jakub Jelinek wrote: Hi! As mentioned in the PR, vect-simd-clone-1[678]{,f}.c tests FAIL on x86_64-linux with -m64/-march=cascadelake or -m32/-march=cascadelake, there are 3 matches for the calls rather than expected two. As suggested by Richi, this patch changes those tests

[ja...@redhat.com: Re: [PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]]

2023-03-21 Thread Jakub Jelinek via Gcc-patches
--- Begin Message --- On Tue, Mar 21, 2023 at 12:35:19PM +, Andrew Stubbs wrote: > > @@ -82,8 +82,7 @@ main () > > /* Ensure the the in-branch simd clones are used on targets that support > > them. > > Some targets use another call for the epilogue loops. */ > > -/* { dg-final { scan-

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
Thanks a lot for the info. Qing > On Mar 20, 2023, at 6:25 PM, Jakub Jelinek wrote: > > On Mon, Mar 20, 2023 at 10:05:57PM +, Qing Zhao via Gcc-patches wrote: >> My question: is the above section the place in C standard “explicitly allows >> contractions”? If not, where it is in C standard

Re: [PATCH] range-op-float: Fix up -ffinite-math-only range extension and don't extend into infinities [PR109008]

2023-03-21 Thread Aldy Hernandez via Gcc-patches
On Mon, Mar 20, 2023 at 5:14 PM Jakub Jelinek wrote: > > On Mon, Mar 13, 2023 at 09:41:47AM +0100, Aldy Hernandez wrote: > > On 3/13/23 09:06, Jakub Jelinek wrote: > > > On Mon, Mar 13, 2023 at 08:59:15AM +0100, Aldy Hernandez wrote: > > > > > Yes, sure - I just noticed that we're forced to use hi

[PATCH] tree-optimization/109219 - avoid looking at STMT_SLP_TYPE

2023-03-21 Thread Richard Biener via Gcc-patches
The following avoids looking at STMT_SLP_TYPE apart from the only place needing it - transform and analysis of non-SLP loop stmts. In particular it doesn't have a reliable meaning on SLP representatives which are also passed as stmt_vinfo to vectorizable_* routines. The proper way to check in thos

Re: [PATCH] range-op-float: Fix up -ffinite-math-only range extension and don't extend into infinities [PR109008]

2023-03-21 Thread Aldy Hernandez via Gcc-patches
On 3/10/23 09:53, Richard Biener wrote: On Fri, 10 Mar 2023, Jakub Jelinek wrote: Coming back to this... /* Temporarily disable -ffinite-math-only, so that frange::set doesn't reduce the range back to real_min_representable (type) as lower bound or real_max_representable (type) as

Re: [PATCH] amdgcn: Add instruction patterns for vector operations on complex numbers

2023-03-21 Thread Andrew Jenner
I have updated this patch to incorporate the feedback from Andrew Stubbs. Tested on CDNA2 GFX90a. gcc/ChangeLog: * config/gcn/gcn-protos.h (gcn_expand_dpp_swap_pairs_insn) (gcn_expand_dpp_distribute_even_insn) (gcn_expand_dpp_distribute_odd_insn): Declare. * config/gcn/gcn-valu.

Re: [PATCH] range-op-float: Fix up -ffinite-math-only range extension and don't extend into infinities [PR109008]

2023-03-21 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 21, 2023 at 02:28:31PM +0100, Aldy Hernandez wrote: > > /* Temporarily disable -ffinite-math-only, so that frange::set doesn't > > reduce the range back to real_min_representable (type) as lower bound > > or real_max_representable (type) as upper bound. */ > > bool save_f

[PATCH] amdgcn: Add accumulator VGPR registers

2023-03-21 Thread Andrew Jenner
This patch gives GCC to use the accumulator VGPR registers on CDNA1 and later architectures. The backend does not yet attempt to make use of the matrix acceleration instructions, but the new registers are still useful as fast space for register spills. And they can now be used in inline assembl

[PATCH] PR tree-optimization/109192 - Terminate GORI calculations if a relation is not relevant.

2023-03-21 Thread Andrew MacLeod via Gcc-patches
As mentioned in the PR, the originally GORI terminated calculation if the LHS was varying as it could not provide any additional useful information on an outgoing edge beyond what folding would give. The original patch  introduced relations, and aloowed GORI to keep going with the hope that th

Re: [PATCH] range-op-float: Fix up -ffinite-math-only range extension and don't extend into infinities [PR109008]

2023-03-21 Thread Aldy Hernandez via Gcc-patches
On 3/21/23 14:39, Jakub Jelinek wrote: On Tue, Mar 21, 2023 at 02:28:31PM +0100, Aldy Hernandez wrote: /* Temporarily disable -ffinite-math-only, so that frange::set doesn't reduce the range back to real_min_representable (type) as lower bound or real_max_representable (type) a

Re: [PATCH] range-op-float: Fix up -ffinite-math-only range extension and don't extend into infinities [PR109008]

2023-03-21 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 21, 2023 at 02:49:49PM +0100, Aldy Hernandez wrote: > So, this? > > frange::set (tree type, > const REAL_VALUE_TYPE &min, > const REAL_VALUE_TYPE &max, > const nan_state &, > value_range_kind kind = VR_RANGE) > > If so, I'll start poking at it. Yes. J

Re: [PATCH] PR tree-optimization/109192 - Terminate GORI calculations if a relation is not relevant.

2023-03-21 Thread Richard Biener via Gcc-patches
On Tue, Mar 21, 2023 at 2:44 PM Andrew MacLeod via Gcc-patches wrote: > > As mentioned in the PR, the originally GORI terminated calculation if > the LHS was varying as it could not provide any additional useful > information on an outgoing edge beyond what folding would give. > > The original pat

[PATCH 1/2] c++: implement __is_function built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

Re: [PATCH v2] doc: md.texi (Insn Splitting): Tweak wording for readability.

2023-03-21 Thread Hans-Peter Nilsson via Gcc-patches
> From: Hans-Peter Nilsson > CC: , > Date: Tue, 14 Mar 2023 17:04:43 +0100 Ping on contents (formatting is approved): > I needed to check what was allowed in a define_split, but > had problems understanding what was meant by "Splitting of > jump instruction into sequence that over by another ju

[PATCH 2/2] libstdc++: use new built-in trait __is_function

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_function. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libstdc++-v3/include/std

Re: [PATCH v2] c++: further -Wdangling-reference refinement [PR107532]

2023-03-21 Thread Jason Merrill via Gcc-patches
On 3/20/23 18:06, Marek Polacek wrote: On Sat, Mar 18, 2023 at 08:35:36AM -0400, Jason Merrill wrote: On 3/17/23 16:29, Marek Polacek wrote: Based on , it seems like we should treat *any* class with a reference member as a reference wrapp

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 20, 2023, at 6:25 PM, Jakub Jelinek wrote: > > On Mon, Mar 20, 2023 at 10:05:57PM +, Qing Zhao via Gcc-patches wrote: >> My question: is the above section the place in C standard “explicitly allows >> contractions”? If not, where it is in C standard? > > http://port70.net/%7Ensz/

[pushed] c++: DMI in template with virtual base [PR106890]

2023-03-21 Thread Jason Merrill via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- When parsing a default member init we just build a CONVERT_EXPR for converting to a virtual base, and then expand that into the more complex form when we actually use the DMI in a constructor. But that wasn't working for the template case w

Re: [PATCH] amdgcn: Add instruction patterns for vector operations on complex numbers

2023-03-21 Thread Andrew Stubbs
On 21/03/2023 13:35, Andrew Jenner wrote: I have updated this patch to incorporate the feedback from Andrew Stubbs. Tested on CDNA2 GFX90a. gcc/ChangeLog:     * config/gcn/gcn-protos.h (gcn_expand_dpp_swap_pairs_insn)     (gcn_expand_dpp_distribute_even_insn)     (gcn_expand_dpp_distribute_

[PATCH] testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32

2023-03-21 Thread Hans-Peter Nilsson via Gcc-patches
(CC to respectively author and committer of pr100359.c.) Tested cris-elf and native x86_64-linux: the two scan-tree-dumps pass and x86_64-linux still links. Ok to commit? -- >8 -- The test gcc.dg/tree-ssa/pr100359.c fails the "test for excess errors" for at least m68k-linux, pru-elf, and cris-el

libgomp: Simplify OpenMP reverse offload host <-> device memory copy implementation (was: [Patch] libgomp/nvptx: Prepare for reverse-offload callback handling)

2023-03-21 Thread Thomas Schwinge
Hi! On 2022-08-26T11:07:28+0200, Tobias Burnus wrote: > This patch adds initial [OpenMP reverse offload] support for nvptx. > CUDA does lockup when trying to copy data from the currently running > stream; hence, a new stream is generated to do the memory copying. As part of other work, where I

Re: [PATCH] amdgcn: Add accumulator VGPR registers

2023-03-21 Thread Andrew Stubbs
On 21/03/2023 13:42, Andrew Jenner wrote: This patch gives GCC to use the accumulator VGPR registers on CDNA1 and later architectures. The backend does not yet attempt to make use of the matrix acceleration instructions, but the new registers are still useful as fast space for register spills.

[PATCH 1/2] c++: implement __is_unsigned built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_unsigned. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unsigned. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNSIGNED. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH 2/2] libstdc++: use new built-in trait __is_unsigned

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_unsigned. libstdc++-v3/ChangeLog: * include/std/type_traits (is_unsigned): Use __is_unsigned built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libstdc++-v3/include/std

Re: [PATCH 1/2] c++: implement __is_unsigned built-in trait

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 16:40, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch implements built-in trait for std::is_unsigned. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __is_unsigned. > * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNSIGNED. >

Re: [PATCH 2/2] libstdc++: use new built-in trait __is_unsigned

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 16:41, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch lets libstdc++ use new built-in trait __is_unsigned. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_unsigned): Use __is_unsigned > built-in trait. > Please wrap the ChangeLog

Re: [PATCH] testsuite: Compile-only gcc.dg/tree-ssa/pr100359.c if ! natural_alignment_32

2023-03-21 Thread Richard Biener via Gcc-patches
> Am 21.03.2023 um 16:38 schrieb Hans-Peter Nilsson via Gcc-patches > : > > (CC to respectively author and committer of pr100359.c.) > > Tested cris-elf and native x86_64-linux: the two > scan-tree-dumps pass and x86_64-linux still links. Ok to > commit? Ok Richard > -- >8 -- > The test

[PATCH v2] libstdc++: Fix handling of surrogate CP in codecvt [PR108976]

2023-03-21 Thread Dimitrij Mijoski via Gcc-patches
This patch fixes the handling of surrogate code points in all standard facets for transcoding Unicode that are based on std::codecvt. Surrogate code points should always be treated as error. On the other hand surrogate code units can only appear in UTF-16 and only when they come in a proper pair.

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Paul Koning via Gcc-patches
> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches > wrote: > > ... > Most of the compiler users are not familiar with language standards, or no > access to language standards. Without clearly documenting such warnings along > with the option explicitly, the users have not way to kno

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: > > > >> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches >> wrote: >> >> ... >> Most of the compiler users are not familiar with language standards, or no >> access to language standards. Without clearly documenting such warnings

[committed] libstdc++: Fix simd compilation with Clang

2023-03-21 Thread Matthias Kretz via Gcc-patches
Slightly modified patch. I had to fix floating-point AVX512 blending on Clang by removing a cast. While at it I cleaned up the -Wundef noise. - 8< -- Clang fails to compile some constant expressions involving simd. Therefore, just disable this non-conforming extension for clang. Fix AVX

Re: [PATCH 2/2] libstdc++: use new built-in trait __is_unsigned

2023-03-21 Thread Ken Matsui via Gcc-patches
I see. Thank you! On Tue, Mar 21, 2023 at 9:44 AM Jonathan Wakely wrote: > > > On Tue, 21 Mar 2023 at 16:41, Ken Matsui via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> This patch lets libstdc++ use new built-in trait __is_unsigned. >> >> libstdc++-v3/ChangeLog: >> >> * include/std/

[PATCH] libstdc++: Skip integer division optimization for Clang

2023-03-21 Thread Matthias Kretz via Gcc-patches
Tested on x86_64-pc-linux-gnu. - 8< --- Clang ICEs on _SimdImplX86::_S_divides. The function is only working around a missed optimization and not necessary for correctness. Therefore, don't use it for Clang. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * inclu

[PATCH] libstdc++: Use more precise __RECIPROCAL_MATH__ macro

2023-03-21 Thread Matthias Kretz via Gcc-patches
Tested on x86_64-pc-linux-gnu. - 8< --- Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_SimdImplX86::_S_divides): Replace test for __GCC_IEC_559 == 0 with __RECIPROCAL_MATH__. --- libstdc++-v3/include/exper

[PATCH v2 1/2] c++: implement __is_unsigned built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_unsigned. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unsigned. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNSIGNED. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v2 2/2] libstdc++: use new built-in trait __is_unsigned

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_unsigned. libstdc++-v3/ChangeLog: * include/std/type_traits (is_unsigned): Use __is_unsigned built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libstdc++-v3/incl

Re: [PATCH] libstdc++: Use more precise __RECIPROCAL_MATH__ macro

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 17:05, Matthias Kretz via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Tested on x86_64-pc-linux-gnu. > > - 8< --- > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * include/experimental/bits/simd_x86.h > (_SimdImplX86::_S_div

Re: [PATCH] libstdc++: Skip integer division optimization for Clang

2023-03-21 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Mar 2023 at 17:06, Matthias Kretz via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Tested on x86_64-pc-linux-gnu. > > - 8< --- > > Clang ICEs on _SimdImplX86::_S_divides. The function is only working > around a missed optimization and not necessary for correctness. > Ther

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches wrote: ... Most of the compiler users are not familiar with language standards, or no access to language standards. Without cl

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Paul Koning via Gcc-patches
> On Mar 21, 2023, at 1:59 PM, Jeff Law via Gcc-patches > wrote: > > > > On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: >>> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: >>> >>> >>> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches wrote: ... Mos

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Alexander Monakov via Gcc-patches
On Tue, 21 Mar 2023, Jeff Law via Gcc-patches wrote: > On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: > > > >> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: > >> > >>> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches > >>> wrote: > >>> > >>> ... > >>> Most of the compiler users

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 12:12, Alexander Monakov wrote: Yes, it’s better to know the details of languages standard. -:) However, I don’t think that this is a realistic expectation to the compiler users: to know all the details of a language standard. Umm, they really do need to know that stuff. If the d

Re: [PATCH V2, rs6000] Tweak modulo define_insns to eliminate register copy

2023-03-21 Thread Segher Boessenkool
Hi! On Tue, Mar 21, 2023 at 07:10:04AM -0500, Pat Haugen wrote: > Updated patch with review comments addressed: fixed up testcase and added > another testcase to verify peephole is functional. > > Don't force target of modulo into a distinct register. > > The define_insns for the modulo operatio

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Toon Moene
On 3/21/23 19:03, Paul Koning via Gcc-patches wrote: Failure to understand the language is a common problem and we do try to emit various diagnostics to help developers avoid writing non-conformant code. But ultimately if a developer fails to understand the language standard, then they're go

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 21, 2023, at 1:59 PM, Jeff Law via Gcc-patches > wrote: > > > > On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: >>> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: >>> >>> >>> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches wrote: ... Most

Re: [PATCH] Fortran: reject MODULE PROCEDURE outside generic module interface [PR99036]

2023-03-21 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 21.03.23 um 09:31 schrieb Tobias Burnus: On 20.03.23 21:57, Harald Anlauf via Gcc-patches wrote: --- a/gcc/fortran/decl.cc +++ b/gcc/fortran/decl.cc @@ -9998,6 +9998,7 @@ gfc_match_modproc (void)     if ((gfc_state_stack->state != COMP_INTERFACE && gfc_state_stack->state

[wwwdocs] Document support for znver4 in gcc-13/changes.html

2023-03-21 Thread Martin Jambor
Hello, is the following item documenting that gcc13 can generate code for Zen 4 OK for the changes.html file on the web? Thanks, Martin diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html index 4fae1f7a..f8e9560c 100644 --- a/htdocs/gcc-13/changes.html +++ b/htdocs/gcc-13/chan

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 13:01, Qing Zhao wrote: The code previously worked now has some issue since we added some new stuff into standard, and the compiler added some new transformation based on this new stuff. Should the compiler issue some warnings to warn the users about such change? Then the user

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 21, 2023, at 3:51 PM, Jeff Law wrote: > > > > On 3/21/23 13:01, Qing Zhao wrote: > >> The code previously worked now has some issue since we added some new stuff >> into standard, and the compiler added some new transformation based on this >> new stuff. Should the compiler issue

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 21, 2023 at 07:01:36PM +, Qing Zhao via Gcc-patches wrote: > In addition to this, Standards have been changed from time to time. So, the user needs to know the standard they are compiling for. Anyway, talking again about contractions, it isn't anything new in the standard, C99 had

[PATCH 1/2] c++: implement __is_array built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARRAY. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/Chan

[PATCH 2/2] libstdc++: use new built-in trait __is_array

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_array. libstdc++-v3/ChangeLog: * include/std/type_traits (is_array): Use __is_array built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libstdc++-v3/include/std/type_trai

Re: Ping (gcc/configure.ac, docs): [PATCH v2 4/5] Update texinfo.tex, remove the @gol macro/alias

2023-03-21 Thread Gerald Pfeifer
On Tue, 21 Mar 2023, Arsen Arsenović wrote: > Done! > > Gerald, please update the scripts when you get a chance (but back the > old ones up just in case!) Done. Minus the backup, since everything is in Git anyways, isn't it? :-) The script should run in about 1 hour and 45 minutes. > If makeinf

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 13:12, Jakub Jelinek wrote: On Tue, Mar 21, 2023 at 07:01:36PM +, Qing Zhao via Gcc-patches wrote: In addition to this, Standards have been changed from time to time. So, the user needs to know the standard they are compiling for. Anyway, talking again about contractions, it

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 21, 2023 at 05:28:52PM -0600, Jeff Law via Gcc-patches wrote: > On 3/21/23 13:12, Jakub Jelinek wrote: > > On Tue, Mar 21, 2023 at 07:01:36PM +, Qing Zhao via Gcc-patches wrote: > > > In addition to this, Standards have been changed from time to time. > > > > So, the user needs to

[PATCH] PR target/105325, Make load/cmp fusion know about prefixed loads

2023-03-21 Thread Michael Meissner via Gcc-patches
The issue with the bug is the power10 load GPR + cmpi -1/0/1 fusion optimization generates illegal assembler code. Ultimately the code was dying because the fusion load + compare -1/0/1 patterns did not handle the possibility that the load might be prefixed. The main cause is the constraints for

[PATCH 1/2] c++: implement __is_const built-in trait

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_const. gcc/cp/ChangeLog: * cp-trait.def: Define __is_const. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/Chan

[PATCH 2/2] libstdc++: use new built-in trait __is_const

2023-03-21 Thread Ken Matsui via Gcc-patches
This patch lets libstdc++ use new built-in trait __is_const. libstdc++-v3/ChangeLog: * include/std/type_traits (is_const): Use __is_const built-in trait. --- libstdc++-v3/include/std/type_traits | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libstdc++-v3/include/std/type_trai

[patch V2] Docs, OpenMP: Correct internal documentation of OMP_FOR

2023-03-21 Thread Sandra Loosemore
Here is a cleaned-up version of my RFC patch from about a month ago, incorporating some comments from Tobias. This version also fixes the tree.def comments (I just cut-and-pasted from the revised Texinfo docs and removed the markup, so it should all be consistent now). I'll use my doc maintai

[PATCH] RISC-V: Fix ICE in LRA for LMUL < 1 vector spillings

2023-03-21 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * config/riscv/riscv-protos.h (emit_vlmax_vsetvl): Define as global. (emit_vlmax_op): Ditto. * config/riscv/riscv-v.cc (get_sew): New function. (emit_vlmax_vsetvl): Adapt function. (emit_pred_op): Ditto. (emit_vlma

[PATCH] Remove TARGET_GEN_MEMSET_SCRATCH_RTX since it's not used anymore.

2023-03-21 Thread liuhongt via Gcc-patches
The target hook is only used by i386, and the current definition is same as default gen_reg_rtx. So there's no need for this target hook. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for trunk(or GCC14)? gcc/ChangeLog: * builtins.cc (builtin_memset_read_str): Replace

Re: [PATCH-1, rs6000] Put constant into pseudo at expand when it needs two insns [PR86106]

2023-03-21 Thread HAO CHEN GUI via Gcc-patches
Hi Richard, 在 2023/3/16 15:57, Richard Biener 写道: > I'm not sure if careful constraints massaging like adding magic letters to > alternatives with constants to pessimize them for LRA, making them > more expensive than spilling the constant to a register but avoid > secondary reloads with spilling

[PATCH V3] RISC-V: Fix a redefinition bug for the fd-4.c

2023-03-21 Thread shiyulong
From: yulong This patch fix a redefinition bug. There are have a definition about mode_t in the fd-4.c, but it duplicates the definition in stdio.h. gcc/testsuite/ChangeLog: * gcc.dg/analyzer/fd-4.c: delete the definition of mode_t. --- gcc/testsuite/gcc.dg/analyzer/fd-4.c | 5 -

[PATCH] RISC-V: Fix PR109228

2023-03-21 Thread juzhe . zhong
From: Ju-Zhe Zhong This patch fix PR109228 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109228 gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc (class vlenb): Add __riscv_vlenb support. (BASE): Ditto. * config/riscv/riscv-vector-builtins-bases.h: Ditto.

Re: [PATCH] range-op-float: Fix up -ffinite-math-only range extension and don't extend into infinities [PR109008]

2023-03-21 Thread Aldy Hernandez via Gcc-patches
On 3/21/23 14:56, Jakub Jelinek wrote: On Tue, Mar 21, 2023 at 02:49:49PM +0100, Aldy Hernandez wrote: So, this? frange::set (tree type, const REAL_VALUE_TYPE &min, const REAL_VALUE_TYPE &max, const nan_state &, value_range_kind kind = VR_RANGE) If so, I'll st