Re: [PATCH] [testsuite] [powerpc] adjust -m32 counts for fold-vec-extract*

2023-05-24 Thread Kewen.Lin via Gcc-patches
Hi Alexandre, on 2023/5/24 13:51, Alexandre Oliva wrote: > > Codegen changes caused add instruction count mismatches on > ppc-*-linux-gnu and other 32-bit ppc targets. At some point the > expected counts were adjusted for lp64, but ilp32 differences > remained, and published test results

Re: [V7][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-05-24 Thread Bernhard Reutner-Fischer via Gcc-patches
On 24 May 2023 16:09:21 CEST, Qing Zhao wrote: >Bernhard, > >Thanks a lot for your comments. > >> On May 19, 2023, at 7:11 PM, Bernhard Reutner-Fischer >> wrote: >> >> On Fri, 19 May 2023 20:49:47 + >> Qing Zhao via Gcc-patches wrote: >> >>> GCC extension accepts the case when a struct

[COMMITTED] Stream out NANs correctly.

2023-05-24 Thread Aldy Hernandez via Gcc-patches
NANs don't have bounds, so there's no need to stream them out. gcc/ChangeLog: * data-streamer-in.cc (streamer_read_value_range): Handle NANs. * data-streamer-out.cc (streamer_write_vrange): Same. * value-range.h (class vrange): Make streamer_write_vrange a friend. ---

[COMMITTED] Disallow setting of NANs in frange setter unless setting trees.

2023-05-24 Thread Aldy Hernandez via Gcc-patches
frange::set() is confusing in that we can set a NAN by specifying a bound of +-NAN, even though we tecnically disallow NANs in the setter because the kind can never be VR_NAN. This is a wart for get_tree_range(), which builds a range out of a tree from the source, to work correctly. It's ugly,

[COMMITTED] Hash known NANs correctly for franges.

2023-05-24 Thread Aldy Hernandez via Gcc-patches
We're ICEing when trying to hash a known NAN. This is unnoticeable because the only user would be IPA, and even so, it currently doesn't handle floats. However, handling floats is a flip of a switch, so it's best to handle them already. gcc/ChangeLog: * value-range.cc (add_vrange):

[COMMITTED] Add an frange::set_nan() variant that takes a nan_state.

2023-05-24 Thread Aldy Hernandez via Gcc-patches
Generalize frange::set_nan() to take a nan_state and make current set_nan() methods syntactic sugar. This is in preparation for better streaming of NANs for LTO/IPA. gcc/ChangeLog: * value-range.h (frange::set_nan): New. --- gcc/value-range.h | 32 +--- 1

[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956 --- Comment #10 from Andrew Pinski --- (In reply to Alexander Monakov from comment #8) > I think the following testcase indicates that GCC assumes that tail padding > is accessible: Well it aligned accesses are always accessable the

[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};

2023-05-24 Thread muecker at gwdg dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956 --- Comment #9 from Martin Uecker --- Clang as well, but that would be only padding inside the first part without taking into account extra element in the FAM. I am more concert about programmers using the formula sizeof(.) + n * sizeof for

Re: [PATCH v2] rs6000: Add buildin for mffscrn instructions

2023-05-24 Thread Kewen.Lin via Gcc-patches
on 2023/5/24 23:20, Carl Love wrote: > On Wed, 2023-05-24 at 13:32 +0800, Kewen.Lin wrote: >> on 2023/5/24 06:30, Peter Bergner wrote: >>> On 5/23/23 12:24 AM, Kewen.Lin wrote: on 2023/5/23 01:31, Carl Love wrote: > The builtins were requested for use in GLibC. As of version > 2.31

[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};

2023-05-24 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956 Alexander Monakov changed: What|Removed |Added CC||amonakov at gcc dot gnu.org ---

[Bug fortran/90504] Improved NORM2 algorithm

2023-05-24 Thread jb at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90504 --- Comment #2 from Janne Blomqvist --- (In reply to anlauf from comment #1) > (In reply to Janne Blomqvist from comment #0) > > Hanson, Hopkins, Remark on Algorithm 539: A Modern Fortran Reference > > Implementation for Carefully Computing the

Re: Re: RISC-V Bootstrap problems

2023-05-24 Thread juzhe.zh...@rivai.ai
>> It's highly unlikely we'll switch from the mechanisms we're using. >>They're pretty deeply embedded into how all the ports are developed and >>work. We just take a look at the build file. It seems that the functions generated by define_insn are so many. Do we have the chance optimize it? I

Re: RISC-V Bootstrap problems

2023-05-24 Thread Kito Cheng via Gcc-patches
Yeah, JoJo still working on toolchain stuff, but just not active on upstream GCC cc. jojo On Thu, May 25, 2023 at 12:06 PM Jeff Law wrote: > > > > On 5/24/23 21:53, Kito Cheng wrote: > > Jojo has a patch to try to split those things that should help this, > > but seems not landed. > > > >

Re: RISC-V Bootstrap problems

2023-05-24 Thread Jeff Law
On 5/24/23 21:54, juzhe.zh...@rivai.ai wrote: >> IIRC LLVM is using the table driven mechanism, so it's less impact on the compilation time when the instruction becomes more and more. Oh, I see. Could you share more details ? Maybe we can support this in GCC. It's highly unlikely we'll

Re: RISC-V Bootstrap problems

2023-05-24 Thread Jeff Law
On 5/24/23 21:53, Kito Cheng wrote: Jojo has a patch to try to split those things that should help this, but seems not landed. https://patchwork.ozlabs.org/project/gcc/patch/20201104015315.81416-1-jiejie_r...@c-sky.com/ Is JoJo still active? I haven't heard from JoJo in many months, perhaps

Re: [PATCH] RISC-V: Remove FRM_REGNUM dependency for rtx conversions

2023-05-24 Thread Kito Cheng via Gcc-patches
LGTM, thanks :) On Wed, May 24, 2023 at 7:26 PM wrote: > > From: Juzhe-Zhong > > According to RVV ISA: > The conversions use the dynamic rounding mode in frm, except for the rtz > variants, which round towards zero. > > So rtz conversion patterns should not have FRM dependency. > > We can't

Re: Re: RISC-V Bootstrap problems

2023-05-24 Thread juzhe.zh...@rivai.ai
>> IIRC LLVM is using the table driven mechanism, so it's less impact on the >> compilation time when the instruction becomes more and more. Oh, I see. Could you share more details ? Maybe we can support this in GCC. juzhe.zh...@rivai.ai From: Kito Cheng Date: 2023-05-25 11:53 To:

Re: Re: RISC-V Bootstrap problems

2023-05-24 Thread Kito Cheng via Gcc-patches
Jojo has a patch to try to split those things that should help this, but seems not landed. https://patchwork.ozlabs.org/project/gcc/patch/20201104015315.81416-1-jiejie_r...@c-sky.com/ > How about LLVM? Can kito help with this issue? > LLVM has already supported full intrinsics for a long time

Re: Re: RISC-V Bootstrap problems

2023-05-24 Thread juzhe.zh...@rivai.ai
Besides, we don't have compilation issues in crossing-compiling (with segment intrinsics). But I do agree we need to address such issue. As far as I known, GCC compile insn-emit in single thread single core. Can we multi-thread && multi-core to compile it to speed up the compilation? Thanks.

Re: Re: RISC-V Bootstrap problems

2023-05-24 Thread juzhe.zh...@rivai.ai
segment intrinsics are really huge amount. Even though I have tried to optimized them, still we have the issues.. How about LLVM? Can kito help with this issue? LLVM has already support full intrinsics for a long time and no issues. Thanks. juzhe.zh...@rivai.ai From: Jeff Law Date:

Re: RISC-V Bootstrap problems

2023-05-24 Thread Jeff Law via Gcc-patches
On 5/24/23 17:13, Palmer Dabbelt wrote: On Wed, 24 May 2023 16:12:20 PDT (-0700), Vineet Gupta wrote: [ ... big snip ... ] Never mind. Looks like I found the issue - with just trial and error and no idea of how this stuff works. The torture-{init,finish} needs to be in riscv.exp not

Re: [PATCH] LoongArch: Fix the problem of structure parameter passing in C++. This structure has empty structure members and less than three floating point members.

2023-05-24 Thread Lulu Cheng
在 2023/5/25 上午10:52, WANG Xuerui 写道: On 2023/5/25 10:46, Lulu Cheng wrote: 在 2023/5/25 上午4:15, Jason Merrill 写道: On Wed, May 24, 2023 at 5:00 AM Jonathan Wakely via Gcc-patches mailto:gcc-patches@gcc.gnu.org>> wrote:     On Wed, 24 May 2023 at 09:41, Xi Ruoyao wrote:     > Wang Lei

Re: [PATCH] i386: Fix incorrect intrinsic signature for AVX512 s{lli|rai|rli}

2023-05-24 Thread Hongtao Liu via Gcc-patches
On Thu, May 25, 2023 at 10:55 AM Hu, Lin1 via Gcc-patches wrote: > > Hi all, > > This patch aims to fix incorrect intrinsic signature for > _mm{512|256|}_s{lli|rai|rli}_epi*. And it has been tested on > x86_64-pc-linux-gnu. OK for trunk? > > BRs, > Lin > > gcc/ChangeLog: > > PR

[Bug tree-optimization/109959] `(a > 1) ? 0 : (a == 1)` is not optimized when spelled out at -O2+

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109959 --- Comment #4 from Andrew Pinski --- Note the underlaying issue with VRP is similar to PR 109959 but it is about a slightly different optimization though.

RE: [PATCH v6] RISC-V: Using merge approach to optimize repeating sequence

2023-05-24 Thread Li, Pan2 via Gcc-patches
Oops, forget to remove it in previous version, will wait a while and update them together. Pan From: juzhe.zh...@rivai.ai Sent: Thursday, May 25, 2023 11:14 AM To: Li, Pan2 ; gcc-patches Cc: Kito.cheng ; Li, Pan2 ; Wang, Yanzhang Subject: Re: [PATCH v6] RISC-V: Using merge approach to

Re: [PATCH v6] RISC-V: Using merge approach to optimize repeating sequence

2023-05-24 Thread juzhe.zh...@rivai.ai
* machmode.h (VECTOR_BOOL_MODE_P): New macro. --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -134,6 +134,10 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES]; || GET_MODE_CLASS (MODE) == MODE_VECTOR_ACCUM \ || GET_MODE_CLASS (MODE) == MODE_VECTOR_UACCUM) +/* Nonzero if MODE

RE: Re: [PATCH V5] RISC-V: Using merge approach to optimize repeating sequence in vec_init

2023-05-24 Thread Li, Pan2 via Gcc-patches
Hi Kito, Update the PATCH v6 with refactored framework as below, thanks for comments. https://gcc.gnu.org/pipermail/gcc-patches/2023-May/619536.html Pan -Original Message- From: Gcc-patches On Behalf Of Kito Cheng via Gcc-patches Sent: Wednesday, May 17, 2023 11:52 AM To:

[PATCH v6] RISC-V: Using merge approach to optimize repeating sequence

2023-05-24 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to optimize the VLS vector initialization like repeating sequence. From the vslide1down to the vmerge with a simple cost model, aka every instruction only has 1 cost. Given code with -march=rv64gcv_zvl256b --param riscv-autovec-preference=fixed-vlmax typedef

[Bug fortran/109948] [13/14 Regression] ICE(segfault) in gfc_expression_rank() from gfc_op_rank_conformable()

2023-05-24 Thread rimvydas.jas at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109948 --- Comment #5 from Rimvydas (RJ) --- (In reply to anlauf from comment #4) > Can you check if this works for you? This patch allows to avoid issue on all other associate use cases (tried on gcc-13 branch). However it is a bit suspicious that

Re: Re: [PATCH V14] VECT: Add decrement IV iteration loop control by variable amount support

2023-05-24 Thread juzhe.zh...@rivai.ai
Hi, Richard. After several tries with your testcases (I already added into V15 patch). I think "using a new IV" would be better than "multiplication" Now: loop_len_34 = MIN_EXPR ; _74 = MIN_EXPR ; --> multiplication approach will changed into _74 = loop_len_34 * 2; loop_len_48 =

[PATCH V15] VECT: Add decrement IV iteration loop control by variable amount support

2023-05-24 Thread juzhe . zhong
From: Ju-Zhe Zhong This patch is supporting decrement IV by following the flow designed by Richard: (1) In vect_set_loop_condition_partial_vectors, for the first iteration of: call vect_set_loop_controls_directly. (2) vect_set_loop_controls_directly calculates "step" as in your patch. If

[PATCH] i386: Fix incorrect intrinsic signature for AVX512 s{lli|rai|rli}

2023-05-24 Thread Hu, Lin1 via Gcc-patches
Hi all, This patch aims to fix incorrect intrinsic signature for _mm{512|256|}_s{lli|rai|rli}_epi*. And it has been tested on x86_64-pc-linux-gnu. OK for trunk? BRs, Lin gcc/ChangeLog: PR target/109173 PR target/109174 * config/i386/avx512bwintrin.h

Re: [PATCH] LoongArch: Fix the problem of structure parameter passing in C++. This structure has empty structure members and less than three floating point members.

2023-05-24 Thread WANG Xuerui
On 2023/5/25 10:46, Lulu Cheng wrote: 在 2023/5/25 上午4:15, Jason Merrill 写道: On Wed, May 24, 2023 at 5:00 AM Jonathan Wakely via Gcc-patches mailto:gcc-patches@gcc.gnu.org>> wrote: On Wed, 24 May 2023 at 09:41, Xi Ruoyao wrote: > Wang Lei raised some concerns about Itanium C++

[Bug tree-optimization/109960] [10/11/12/13/14 Regression] missing combining of `(a&1) != 0 || (a&2)!=0` into `(a&3)!=0`

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109960 --- Comment #4 from Andrew Pinski --- I happened to notice this because I am working on a match patch that transform `a ? 1 : b` into `a | b`. In the case of stmt_can_terminate_bb_p, I noticed we had: [local count: 330920071]: _48 =

Re: [PATCH] LoongArch: Fix the problem of structure parameter passing in C++. This structure has empty structure members and less than three floating point members.

2023-05-24 Thread Lulu Cheng
在 2023/5/25 上午4:15, Jason Merrill 写道: On Wed, May 24, 2023 at 5:00 AM Jonathan Wakely via Gcc-patches mailto:gcc-patches@gcc.gnu.org>> wrote: On Wed, 24 May 2023 at 09:41, Xi Ruoyao wrote: > Wang Lei raised some concerns about Itanium C++ ABI, so let's ask a C++ > expert

[Bug target/100106] [10 Regression] ICE in gen_movdi, at config/arm/arm.md:6187 since r10-2840-g70cdb21e

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100106 --- Comment #10 from CVS Commits --- The master branch has been updated by Alexandre Oliva : https://gcc.gnu.org/g:d6b756447cd58bcca20e6892790582308b869817 commit r14-1187-gd6b756447cd58bcca20e6892790582308b869817 Author: Alexandre Oliva

[Bug target/109933] __atomic_test_and_set is broken for BIG ENDIAN riscv targets

2023-05-24 Thread rory.bolt at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109933 --- Comment #9 from Rory Bolt --- Created attachment 55153 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55153=edit patch Tested fix for big endian, NOT tested on little endian

[Bug tree-optimization/109960] [10/11/12/13/14 Regression] missing combining of `(a&1) != 0 || (a&2)!=0` into `(a&3)!=0`

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109960 Andrew Pinski changed: What|Removed |Added Ever confirmed|1 |0 Status|ASSIGNED

[V8][PATCH 0/2]Accept and Handle the case when a structure including a FAM nested in another structure

2023-05-24 Thread Qing Zhao via Gcc-patches
Hi, This is the 8th version of the patch, which rebased on the latest trunk. This is an important patch needed by Linux Kernel security project. compared to the 7th version, the major change are: 1. update the documentation wordings based on Joseph's suggestions. 2. change the name of the new

[PATCH 2/2] Update documentation to clarify a GCC extension [PR77650]

2023-05-24 Thread Qing Zhao via Gcc-patches
on a structure with a C99 flexible array member being nested in another structure. "The GCC extension accepts a structure containing an ISO C99 "flexible array member", or a union containing such a structure (possibly recursively) to be a member of a structure. There are two situations: * A

[PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-05-24 Thread Qing Zhao via Gcc-patches
GCC extension accepts the case when a struct with a C99 flexible array member is embedded into another struct or union (possibly recursively) as the last field. __builtin_object_size should treat such struct as flexible size. gcc/c/ChangeLog: PR tree-optimization/101832 *

[Bug c++/109961] auto assigned from requires and lambda inside

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109961 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Summary|storage size of

[Bug tree-optimization/109960] [10/11/12/13/14 Regression] missing combining of `(a&1) != 0 || (a&2)!=0` into `(a&3)!=0`

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109960 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2023-05-25

[Bug c++/109961] New: storage size of 'variable name' isn't known

2023-05-24 Thread Darrell.Wright at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109961 Bug ID: 109961 Summary: storage size of 'variable name' isn't known Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++

[Bug tree-optimization/109960] [10/11/12/13/14 Regression] missing combining of `(a&1) != 0 || (a&2)!=0` into `(a&3)!=0`

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109960 --- Comment #1 from Andrew Pinski --- We could have a pattern that does: `(a & CST) != 0 ? 1: (bool)a` -> `a & (CST|1) != 0` to fix this I think.

[Bug tree-optimization/109960] [10/11/12/13/14 Regression] missing combining of `(a&1) != 0 || (a&2)!=0` into `(a&3)!=0`

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109960 Andrew Pinski changed: What|Removed |Added Known to work||8.5.0 Known to fail|

[Bug tree-optimization/109960] New: [10/11/12/13/14 Regression] missing combining of `(a&1) != 0 || (a&2)!=0` into `(a&3)!=0`

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109960 Bug ID: 109960 Summary: [10/11/12/13/14 Regression] missing combining of `(a&1) != 0 || (a&2)!=0` into `(a&3)!=0` Product: gcc Version: 14.0 Status: UNCONFIRMED

RE: [PATCH] PR gcc/98350:Handle FMA friendly in reassoc pass

2023-05-24 Thread Cui, Lili via Gcc-patches
> > +rewrite_expr_tree_parallel (gassign *stmt, int width, bool has_fma, > > +const vec > > +) > > { > >enum tree_code opcode = gimple_assign_rhs_code (stmt); > >int op_num = ops.length (); > > @@ -5483,10 +5494,11 @@ rewrite_expr_tree_parallel

[PATCH] Handle FMA friendly in reassoc pass

2023-05-24 Thread Cui, Lili via Gcc-patches
From: Lili Cui Make some changes in reassoc pass to make it more friendly to fma pass later. Using FMA instead of mult + add reduces register pressure and insruction retired. There are mainly two changes 1. Put no-mult ops and mult ops alternately at the end of the queue, which is conducive to

[Bug target/109927] Bootstrap fails for m68k in stage2 compilation of gimple-match.cc

2023-05-24 Thread userm57 at yahoo dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927 --- Comment #18 from Stan Johnson --- $ git clone git://gcc.gnu.org/git/gcc.git $ cd gcc $ git checkout master I'm testing a manual bootstrap of "gcc version 14.0.0 20230524 (experimental) (GCC)" now, accessed via git as s

Re: [PATCH] RISC-V: Add missing torture-init and torture-finish for rvv.exp

2023-05-24 Thread Jeff Law
On 5/24/23 17:12, Vineet Gupta wrote: On 5/24/23 15:13, Vineet Gupta wrote: PASS: gcc.target/riscv/zmmul-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors) PASS: gcc.target/riscv/zmmul-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  

[RFC] RISC-V: Eliminate extension after for *w instructions

2023-05-24 Thread Jivan Hakobyan via Gcc-patches
`This patch tries to prevent generating unnecessary sign extension after *w instructions like "addiw" or "divw". The main idea of it is to add SUBREG_PROMOTED fields during expanding. I have tested on SPEC2017 there is no regression. Only gcc.dg/pr30957-1.c test failed. To solve that I did some

Re: [PATCH] RISC-V: Add missing torture-init and torture-finish for rvv.exp

2023-05-24 Thread Palmer Dabbelt
On Wed, 24 May 2023 16:12:20 PDT (-0700), Vineet Gupta wrote: On 5/24/23 15:13, Vineet Gupta wrote: PASS: gcc.target/riscv/zmmul-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors) PASS: gcc.target/riscv/zmmul-2.c   -O2 -flto -fuse-linker-plugin

Re: [PATCH] RISC-V: Add missing torture-init and torture-finish for rvv.exp

2023-05-24 Thread Vineet Gupta
On 5/24/23 15:13, Vineet Gupta wrote: PASS: gcc.target/riscv/zmmul-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  (test for excess errors) PASS: gcc.target/riscv/zmmul-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects   scan-assembler-times mul\t 1 PASS:

gcc-10-20230524 is now available

2023-05-24 Thread GCC Administrator via Gcc
Snapshot gcc-10-20230524 is now available on https://gcc.gnu.org/pub/gcc/snapshots/10-20230524/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 10 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch

[Bug tree-optimization/109959] `(a > 1) ? 0 : (a == 1)` is not optimized when spelled out at -O2+

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109959 --- Comment #3 from Andrew Pinski --- here is another related testcase but this was the exactly reduced one from bitmap_single_bit_set_p : ``` _Bool f(unsigned a, int t) { void g(void); if (t) return 0; g(); if (a > 1) return

[Bug tree-optimization/109959] `(a > 1) ? 0 : (a == 1)` is not optimized when spelled out at -O2+

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109959 --- Comment #2 from Andrew Pinski --- I should note I found this while looking at code generation of bitmap_single_bit_set_p after a match pattern addition.

[Bug tree-optimization/109959] `(a > 1) ? 0 : (a == 1)` is not optimized when spelled out at -O2+

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109959 Andrew Pinski changed: What|Removed |Added Summary|`(a > 1) ? 0 : (a == 1)` is |`(a > 1) ? 0 : (a == 1)` is

Re: [PATCH] RISC-V: Add missing torture-init and torture-finish for rvv.exp

2023-05-24 Thread Vineet Gupta
On 5/24/23 13:34, Thomas Schwinge wrote: Yeah, at this point I'm not sure whether my recent changes really are related/relevant here. Apparently in addition to Kito's patch below, If I comment out the additional torture options, failures go down drastically. Meaning that *all* those ERRORs

[Bug tree-optimization/109959] New: `(a > 1) ? 0 : (a == 1)` is not optimized when spelled out

2023-05-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109959 Bug ID: 109959 Summary: `(a > 1) ? 0 : (a == 1)` is not optimized when spelled out Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords:

[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};

2023-05-24 Thread joseph at codesourcery dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956 --- Comment #7 from joseph at codesourcery dot com --- I suppose the question is how to interpret "the longest array (with the same element type) that would not make the structure larger than the object being accessed". The difficulty of

[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};

2023-05-24 Thread joseph at codesourcery dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956 --- Comment #6 from joseph at codesourcery dot com --- For the standard, dynamically allocated case, you should only need to allocate enough memory to contain the initial part of the struct and the array members being accessed - not any

[COMMITTED 2/4] - Make ssa_cache a range_query.

2023-05-24 Thread Andrew MacLeod via Gcc-patches
By having an ssa_cache inherit from a range_query, and then providing a range_of_expr routine which returns the current global value, we open up the possibility of folding statements and doing other interesting things with an ssa-cache. In particular, you can now call fold_range()  with an

[COMMITTED 4/4] - Gimple range PHI analyzer and testcases

2023-05-24 Thread Andrew MacLeod via Gcc-patches
This patch provide the framework for a gimple-range phi analyzer. Currently, the  primary purpose is to give better initial values for members of a "phi group" a PHI group is defined as a a group of PHI nodes whose arguments are all either members of the same PHI group, or one of 2 other

[COMMITTED 3/4] Provide relation queries for a stmt.

2023-05-24 Thread Andrew MacLeod via Gcc-patches
This tweaks someof the fold_stmt routines and helpers.. in particular the ones which you provide a vector of ranges to to satisfy any ssa-names. Previously, once the vector was depleted, any remaining values were picked up from the default get_global_range_query() query. It is useful to be

[COMMITTED 1/4] - Make ssa_cache and ssa_lazy_cache virtual.

2023-05-24 Thread Andrew MacLeod via Gcc-patches
I originally implemented the lazy ssa cache by inheriting from an ssa_cache in protected mode and providing the required routines. This makes it a little awkward to do various things, and they also become not quite as interchangeable as I'd like.   Making the routines virtual and using proper

[Bug tree-optimization/107986] [12/13/14 Regression] Bogus -Warray-bounds diagnostic with std::sort

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107986 --- Comment #9 from CVS Commits --- The master branch has been updated by Andrew Macleod : https://gcc.gnu.org/g:1cd5bc387c453126fdb4c9400096180484ecddee commit r14-1179-g1cd5bc387c453126fdb4c9400096180484ecddee Author: Andrew MacLeod Date:

[Bug tree-optimization/107822] [13/14/14 Regression] Dead Code Elimination Regression at -Os (trunk vs. 12.2.0)

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107822 --- Comment #6 from CVS Commits --- The master branch has been updated by Andrew Macleod : https://gcc.gnu.org/g:1cd5bc387c453126fdb4c9400096180484ecddee commit r14-1179-g1cd5bc387c453126fdb4c9400096180484ecddee Author: Andrew MacLeod Date:

[Bug libstdc++/109947] std::expected monadic operations do not support move-only error types yet

2023-05-24 Thread aemseemann at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109947 Martin Seemann changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

Re: [PATCH] testsuite, analyzer: Fix testcases with fclose

2023-05-24 Thread David Malcolm via Gcc-patches
On Tue, 2023-05-23 at 09:34 +, Christophe Lyon wrote: > The gcc.dg/analyzer/data-model-4.c and > gcc.dg/analyzer/torture/conftest-1.c fail with recent glibc headers > and succeed with older headers. > > The new error message is: > warning: use of possibly-NULL 'f' where non-null expected

[Bug fortran/90504] Improved NORM2 algorithm

2023-05-24 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90504 --- Comment #1 from anlauf at gcc dot gnu.org --- (In reply to Janne Blomqvist from comment #0) > Hanson, Hopkins, Remark on Algorithm 539: A Modern Fortran Reference > Implementation for Carefully Computing the Euclidean Norm, >

[Bug fortran/87270] "FINAL" subroutine is called when compiled with "gfortran -O1", but not "gfortran -O0"

2023-05-24 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87270 --- Comment #6 from anlauf at gcc dot gnu.org --- All current compilers seem to give the same, apparently correct result, even with different optimization level. So can we close this finally?

Re: [PATCH] RISC-V: Add missing torture-init and torture-finish for rvv.exp

2023-05-24 Thread Thomas Schwinge via Gcc-patches
Hi! On 2023-05-24T11:18:35-0700, Vineet Gupta wrote: > On 5/22/23 20:52, Vineet Gupta wrote: >> On 5/22/23 02:17, Kito Cheng wrote: >>> Ooops, seems still some issue around here, >> >> Yep still 5000 fails :-( >> >>>   but I found something might >>> related this issue: >>> >>>

[Bug c++/109876] [10/11/12/13/14 Regression] initializer_list not usable in constant expressions in a template

2023-05-24 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109876 --- Comment #9 from Jason Merrill --- (In reply to Marek Polacek from comment #8) > > Instead, we should probably treat num as value-dependent even though it > > actually isn't. > > An attempt to implement that: > > --- a/gcc/cp/pt.cc > +++

[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};

2023-05-24 Thread muecker at gwdg dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956 --- Comment #5 from Martin Uecker --- Clang bug: https://github.com/llvm/llvm-project/issues/62929

[Bug libstdc++/109947] std::expected monadic operations do not support move-only error types yet

2023-05-24 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109947 --- Comment #4 from Jonathan Wakely --- (In reply to Martin Seemann from comment #3) > So it comes down to how to interpret the "Effects:" clause: Does "Equivalent > to " mean that all restrictions of > `value()` apply transitively or is it

[Bug c++/109876] [10/11/12/13/14 Regression] initializer_list not usable in constant expressions in a template

2023-05-24 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109876 --- Comment #8 from Marek Polacek --- > Instead, we should probably treat num as value-dependent even though it > actually isn't. An attempt to implement that: --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -27969,6 +27969,12 @@

Re: [PATCH] LoongArch: Fix the problem of structure parameter passing in C++. This structure has empty structure members and less than three floating point members.

2023-05-24 Thread Jason Merrill via Gcc-patches
On Wed, May 24, 2023 at 5:00 AM Jonathan Wakely via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Wed, 24 May 2023 at 09:41, Xi Ruoyao wrote: > > > Wang Lei raised some concerns about Itanium C++ ABI, so let's ask a C++ > > expert here... > > > > Jonathan: AFAIK the standard and the Itanium

Re: [PATCH V14] VECT: Add decrement IV iteration loop control by variable amount support

2023-05-24 Thread Richard Sandiford via Gcc-patches
I'll look at the samples tomorrow, but just to address one thing: 钟居哲 writes: >>> What gives the best code in these cases? Is emitting a multiplication >>> better? Or is using a new IV better? > Could you give me more detail information about "new refresh IV" approach. > I'd like to try that.

Re: [aarch64] Code-gen for vector initialization involving constants

2023-05-24 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > On Wed, 24 May 2023 at 15:40, Richard Sandiford > wrote: >> >> Prathamesh Kulkarni writes: >> > On Mon, 22 May 2023 at 14:18, Richard Sandiford >> > wrote: >> >> >> >> Prathamesh Kulkarni writes: >> >> > Hi Richard, >> >> > Thanks for the suggestions. Does the

[Bug fortran/104350] ICE in gfc_array_dimen_size(): Bad dimension

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104350 --- Comment #4 from CVS Commits --- The master branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:ec2e86274427a402d2de2199ba550f7295ea9b5f commit r14-1175-gec2e86274427a402d2de2199ba550f7295ea9b5f Author: Harald Anlauf Date:

[Bug fortran/103794] ICE in gfc_check_reshape, at fortran/check.c:4727

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103794 --- Comment #3 from CVS Commits --- The master branch has been updated by Harald Anlauf : https://gcc.gnu.org/g:5fd5d8fb744fd9251d04e4b17d04f2340e6a283b commit r14-1174-g5fd5d8fb744fd9251d04e4b17d04f2340e6a283b Author: Harald Anlauf Date:

Re: [aarch64] Code-gen for vector initialization involving constants

2023-05-24 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 24 May 2023 at 15:40, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Mon, 22 May 2023 at 14:18, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > Hi Richard, > >> > Thanks for the suggestions. Does the attached patch look OK ? > >> >

Re: [PATCH] Fortran: checking and simplification of RESHAPE intrinsic [PR103794]

2023-05-24 Thread Mikael Morin
Le 21/05/2023 à 22:48, Harald Anlauf via Fortran a écrit : Dear all, checking and simplification of the RESHAPE intrinsic could fail in various ways for sufficiently complicated arguments, like array constructors. Debugging revealed that in these cases we determined that the array arguments

Re: [PATCH] Fortran: reject bad DIM argument of SIZE intrinsic in simplification [PR104350]

2023-05-24 Thread Mikael Morin
Le 24/05/2023 à 21:16, Harald Anlauf via Fortran a écrit : Dear all, the attached almost obvious patch fixes an ICE on invalid that may occur when we attempt to simplify an initialization expression with SIZE for an out-of-range DIM argument. Returning gfc_bad_expr allows for a more graceful

[Bug libstdc++/109261] std::experimental::simd is not usable in several constant expressions

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109261 --- Comment #13 from CVS Commits --- The releases/gcc-12 branch has been updated by Matthias Kretz : https://gcc.gnu.org/g:2b502c3119c91fe3ba2313f0842a3bedd395bc91 commit r12-9651-g2b502c3119c91fe3ba2313f0842a3bedd395bc91 Author: Matthias

[Bug libstdc++/109949] new test case experimental/simd/pr109261_constexpr_simd.cc in r12-9647-g3acbaf1b253215 fails

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109949 --- Comment #10 from CVS Commits --- The releases/gcc-12 branch has been updated by Matthias Kretz : https://gcc.gnu.org/g:ff7360dafe209b960535eaaa3efcfbaaa44daff9 commit r12-9652-gff7360dafe209b960535eaaa3efcfbaaa44daff9 Author: Matthias

[Bug libstdc++/109261] std::experimental::simd is not usable in several constant expressions

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109261 --- Comment #12 from CVS Commits --- The releases/gcc-12 branch has been updated by Matthias Kretz : https://gcc.gnu.org/g:8be71168f7bbafa04f592a7524432351ffea71ba commit r12-9650-g8be71168f7bbafa04f592a7524432351ffea71ba Author: Matthias

[Bug libstdc++/109949] new test case experimental/simd/pr109261_constexpr_simd.cc in r12-9647-g3acbaf1b253215 fails

2023-05-24 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109949 --- Comment #9 from CVS Commits --- The master branch has been updated by Matthias Kretz : https://gcc.gnu.org/g:efd2b55d8562c6e80cb7ee8b9b1f9418f0c00cd9 commit r14-1173-gefd2b55d8562c6e80cb7ee8b9b1f9418f0c00cd9 Author: Matthias Kretz Date:

[Bug libstdc++/109947] std::expected monadic operations do not support move-only error types yet

2023-05-24 Thread aemseemann at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109947 --- Comment #3 from Martin Seemann --- Thanks for pointing me to the LWG issue. It makes sense that the error type must be copyable for the `value()` overloads due to potentially throwing a `bad_expected_access` with the embedded error

[Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3};

2023-05-24 Thread muecker at gwdg dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956 --- Comment #4 from Martin Uecker --- The concern would be that a program relying on the size of an object being larger may then have out of bounds accesses. But rereading the standard, I am also not not seeing that this is required. (for the

Re: [PATCH v4] libgfortran: Replace mutex with rwlock

2023-05-24 Thread Thomas Koenig via Gcc-patches
Hi Lipeng, May I know any comment or concern on this patch, thanks for your time  Thanks for your patience in getting this reviewed. A few remarks / questions. Which strategy is used in this implementation, read-preferring or write-preferring? And if read-preferring is used, is there a

[Bug fortran/104350] ICE in gfc_array_dimen_size(): Bad dimension

2023-05-24 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104350 anlauf at gcc dot gnu.org changed: What|Removed |Added Status|NEW |ASSIGNED

[PATCH] Fortran: reject bad DIM argument of SIZE intrinsic in simplification [PR104350]

2023-05-24 Thread Harald Anlauf via Gcc-patches
Dear all, the attached almost obvious patch fixes an ICE on invalid that may occur when we attempt to simplify an initialization expression with SIZE for an out-of-range DIM argument. Returning gfc_bad_expr allows for a more graceful error recovery. Regtested on x86_64-pc-linux-gnu. OK for

[Bug rtl-optimization/101188] [AVR] Miscompilation and function pointers

2023-05-24 Thread gjl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101188 --- Comment #6 from Georg-Johann Lay --- Created attachment 55152 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55152=edit diff testcase by v4.9.2 vs v5.2.1 Code from v4.9.2 is correct, but from v5.2.1 is bogus: --- fail1-4.9.2.sx

[Bug c++/109958] [10/11/12/13/14 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration

2023-05-24 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958 Marek Polacek changed: What|Removed |Added Keywords||ice-on-valid-code

[PATCH RFC] c++: use __cxa_call_terminate for MUST_NOT_THROW [PR97720]

2023-05-24 Thread Jason Merrill via Gcc-patches
Middle-end folks: any thoughts about how best to make the change described in the last paragraph below? Library folks: any thoughts on the changes to __cxa_call_terminate? -- 8< -- [except.handle]/7 says that when we enter std::terminate due to a throw, that is considered an active handler. We

[Bug c++/109958] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration

2023-05-24 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0

[Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration

2023-05-24 Thread ed at catmur dot uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958 Bug ID: 109958 Summary: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration

[COMMITTED] Remove deprecated vrange::kind().

2023-05-24 Thread Aldy Hernandez via Gcc-patches
gcc/ChangeLog: * value-range.h (vrange::kind): Remove. --- gcc/value-range.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index 936eb175062..b8cc2a0e76a 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -100,9 +100,6 @@ public:

  1   2   3   4   >