[PATCH] Fix ICE due to subreg:us_truncate.

2024-10-29 Thread liuhongt
Force_operand issues an ICE when input is (subreg:DI (us_truncate:V8QI)), it's probably because it's an invalid rtx, So refine backend patterns for that. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog: PR target/117318 * config/i386/s

Re: [PATCH] Fix ICE when using -gcodeview with empty struct

2024-07-30 Thread Jeff Law
On 7/28/24 4:41 PM, Mark Harmstone wrote: Empty structs result in empty LF_FIELDLIST types, which are valid, but we weren't accounting for this and assuming they had to contain subtypes. gcc/ * dwarf2codeview.cc (get_type_num_struct): Fix NULL pointer dereference. OK jeff

[PATCH] Fix ICE when using -gcodeview with empty struct

2024-07-28 Thread Mark Harmstone
Empty structs result in empty LF_FIELDLIST types, which are valid, but we weren't accounting for this and assuming they had to contain subtypes. gcc/ * dwarf2codeview.cc (get_type_num_struct): Fix NULL pointer dereference. --- gcc/dwarf2codeview.cc | 7 +-- 1 file changed, 5 insertion

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-19 Thread Jakub Jelinek
On Wed, Jun 19, 2024 at 07:32:28PM +0200, Jakub Jelinek wrote: > Ok, I've tried that, but that doesn't work, it ICEs on the > pr114574-2.c testcase. The following works on quick testing of dg.exp=pr11[45]*.c but haven't bootstrapped/regtested it yet. 2024-06-19 Jakub Jelinek Martin

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-19 Thread Jakub Jelinek
On Wed, Jun 19, 2024 at 09:26:00AM +0200, Martin Uecker wrote: > Ok. Then should it, instead of > > TYPE_CANONICAL (x) > = build_qualified_type (TYPE_CANONICAL (t), TYPE_QUALS (x)); > > be > > tree c = build_qualified_type (TYPE_CANONICAL (t), TYPE_QUALS (x)); > TYPE_CANONICAL (x) = TREE

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-19 Thread Jakub Jelinek
On Wed, Jun 19, 2024 at 09:36:40AM +0200, Richard Biener wrote: > > TYPE_CANONICAL (x) > > = build_qualified_type (TYPE_CANONICAL (t), TYPE_QUALS (x)); > > That looks indeed weird. What are the constraints on 't' for > c_update_type_canonical? If it is TYPE_STRUCTURAL_EQUALITY_P > the ab

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-19 Thread Jakub Jelinek
On Wed, Jun 19, 2024 at 09:26:00AM +0200, Martin Uecker wrote: > Ok. Then should it, instead of > > TYPE_CANONICAL (x) > = build_qualified_type (TYPE_CANONICAL (t), TYPE_QUALS (x)); > > be > > tree c = build_qualified_type (TYPE_CANONICAL (t), TYPE_QUALS (x)); > TYPE_CANONICAL (x) = TREE

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-19 Thread Richard Biener
On Wed, 19 Jun 2024, Martin Uecker wrote: > Am Mittwoch, dem 19.06.2024 um 08:57 +0200 schrieb Richard Biener: > > On Wed, 19 Jun 2024, Martin Uecker wrote: > > > > > Am Mittwoch, dem 19.06.2024 um 08:04 +0200 schrieb Richard Biener: > > > > > > > > > Am 18.06.2024 um 20:18 schrieb Martin Uecker

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-19 Thread Martin Uecker
Am Mittwoch, dem 19.06.2024 um 08:57 +0200 schrieb Richard Biener: > On Wed, 19 Jun 2024, Martin Uecker wrote: > > > Am Mittwoch, dem 19.06.2024 um 08:04 +0200 schrieb Richard Biener: > > > > > > > Am 18.06.2024 um 20:18 schrieb Martin Uecker : > > > > > > > > Am Dienstag, dem 18.06.2024 um 17:

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-18 Thread Richard Biener
On Wed, 19 Jun 2024, Jakub Jelinek wrote: > On Wed, Jun 19, 2024 at 08:04:55AM +0200, Richard Biener wrote: > > >> Note a canonical type should always be unqualified (for > > >> classical qualifiers, not address space or atomic qualification) > > > > > > The logic in build_qualified_type is the s

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-18 Thread Richard Biener
On Wed, 19 Jun 2024, Martin Uecker wrote: > Am Mittwoch, dem 19.06.2024 um 08:04 +0200 schrieb Richard Biener: > > > > > Am 18.06.2024 um 20:18 schrieb Martin Uecker : > > > > > > Am Dienstag, dem 18.06.2024 um 17:27 +0200 schrieb Richard Biener: > > > > > > > > > > Am 18.06.2024 um 17:20 schr

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-18 Thread Martin Uecker
Am Mittwoch, dem 19.06.2024 um 08:29 +0200 schrieb Jakub Jelinek: > On Wed, Jun 19, 2024 at 08:04:55AM +0200, Richard Biener wrote: > > > > Note a canonical type should always be unqualified (for > > > > classical qualifiers, not address space or atomic qualification) > > > > > > The logic in buil

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-18 Thread Martin Uecker
Am Mittwoch, dem 19.06.2024 um 08:04 +0200 schrieb Richard Biener: > > > Am 18.06.2024 um 20:18 schrieb Martin Uecker : > > > > Am Dienstag, dem 18.06.2024 um 17:27 +0200 schrieb Richard Biener: > > > > > > > > Am 18.06.2024 um 17:20 schrieb Martin Uecker : > > > > > > > >  > > > > As discuss

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-18 Thread Jakub Jelinek
On Wed, Jun 19, 2024 at 08:04:55AM +0200, Richard Biener wrote: > >> Note a canonical type should always be unqualified (for > >> classical qualifiers, not address space or atomic qualification) > > > > The logic in build_qualified_type is the same as in this patch, > > it constructs TYPE_CANONICA

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930, PR115502].

2024-06-18 Thread Richard Biener
> Am 18.06.2024 um 20:18 schrieb Martin Uecker : > > Am Dienstag, dem 18.06.2024 um 17:27 +0200 schrieb Richard Biener: >> Am 18.06.2024 um 17:20 schrieb Martin Uecker : >>> >>>  >>> As discussed this replaces the use of check_qualified_type with >>> a simple check for qualifiers as su

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-18 Thread Martin Uecker
Am Dienstag, dem 18.06.2024 um 17:27 +0200 schrieb Richard Biener: > > > Am 18.06.2024 um 17:20 schrieb Martin Uecker : > > > >  > > As discussed this replaces the use of check_qualified_type with > > a simple check for qualifiers as suggested by Jakub in > > c_update_type_canonical. > > Note a

Re: [C PATCH] Fix ICE related to incomplete structures in C23 [PR114930, PR115502].

2024-06-18 Thread Richard Biener
> Am 18.06.2024 um 17:20 schrieb Martin Uecker : > >  > As discussed this replaces the use of check_qualified_type with > a simple check for qualifiers as suggested by Jakub in > c_update_type_canonical. Note a canonical type should always be unqualified (for classical qualifiers, not addres

[C PATCH] Fix ICE related to incomplete structures in C23 [PR114930,PR115502].

2024-06-18 Thread Martin Uecker
As discussed this replaces the use of check_qualified_type with a simple check for qualifiers as suggested by Jakub in c_update_type_canonical. Martin Bootstrapped and regression tested on x86_64. C23: Fix ICE related to incomplete structures [PR114930,PR115502]. The fix for PR1

Re: [PATCH] Fix ICE in rtl check due to CONST_WIDE_INT in CONST_VECTOR_DUPLICATE_P

2024-06-10 Thread Jakub Jelinek
On Tue, Jun 11, 2024 at 01:36:35PM +0800, liuhongt wrote: > In theory, const_wide_int can also be handle with extra check for each > components of the HOST_WIDE_INT array, and the check is need for both > shift and bit_and operands. > I assume the optimization opportnunity is rare, so the patch ju

[PATCH] Fix ICE in rtl check due to CONST_WIDE_INT in CONST_VECTOR_DUPLICATE_P

2024-06-10 Thread liuhongt
In theory, const_wide_int can also be handle with extra check for each components of the HOST_WIDE_INT array, and the check is need for both shift and bit_and operands. I assume the optimization opportnunity is rare, so the patch just add extra check to make sure GET_MODE_INNER (mode) can fix into

Re: [C PATCH] Fix ICE with -g and -std=c23 related to incomplete types [PR114361]

2024-04-02 Thread Joseph Myers
On Tue, 2 Apr 2024, Martin Uecker wrote: > Fix ICE with -g and -std=c23 related to incomplete types [PR114361] > > We did not copy TYPE_CANONICAL to the incomplete variants when > completing a structure. > > PR c/114361 > > gcc/c/ > * c-decl.c (finish_struct): Set TY

[C PATCH] Fix ICE with -g and -std=c23 related to incomplete types [PR114361]

2024-04-02 Thread Martin Uecker
I did not copy TYPE_CANONICAL to incomplete variants when they are completed. Bootstrapped and regession tested on x86_64 Fix ICE with -g and -std=c23 related to incomplete types [PR114361] We did not copy TYPE_CANONICAL to the incomplete variants when completing a structure.

Re: [C PATCH] Fix ICE for composite type for structs with unsigned bitfields [PR113492]

2024-01-20 Thread Joseph Myers
On Sat, 20 Jan 2024, Martin Uecker wrote: > C23: Fix ICE for composite type for structs with unsigned bitfields [PR113492] > > This patch fixes a bug when forming a composite type from structs that > contain an unsigned bitfield declared with int while using > -funsigned-bitfields. > In such

[C PATCH] Fix ICE for composite type for structs with unsigned bitfields [PR113492]

2024-01-20 Thread Martin Uecker
C23: Fix ICE for composite type for structs with unsigned bitfields [PR113492] This patch fixes a bug when forming a composite type from structs that contain an unsigned bitfield declared with int while using -funsigned-bitfields. In such structs the unsigned integer type was not compatible

[PATCH] Fix ICE of unrecognizable insn.

2023-11-15 Thread liuhongt
The new added splitter will generate (insn 58 56 59 2 (set (reg:V4HI 20 xmm0 [129]) (vec_duplicate:V4HI (reg:HI 22 xmm2 [123]))) "testcase.c":16:21 -1 But we only have (define_insn "*vec_dupv4hi" [(set (match_operand:V4HI 0 "register_operand" "=y,Yw") (vec_duplicate:V4HI

[PATCH] Fix ICE with SLP and -fdbg-cnt

2023-11-15 Thread Richard Biener
We have to clear the visited flag on stmts. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-vect-slp.cc (vect_slp_region): Also clear visited flag when we skipped an instance due to -fdbg-cnt. --- gcc/tree-vect-slp.cc | 9 ++--- 1 file changed, 6 insertion

Re: [PATCH] Fix ICE in vectorizable_nonlinear_induction with bitfield.

2023-11-14 Thread Richard Biener
On Tue, Nov 14, 2023 at 1:56 AM liuhongt wrote: > > if (TREE_CODE (init_expr) == INTEGER_CST) > init_expr = fold_convert (TREE_TYPE (vectype), init_expr); > else > gcc_assert (tree_nop_conversion_p (TREE_TYPE (vectype), >TREE_TYPE (init_expr))); >

[PATCH] Fix ICE in vectorizable_nonlinear_induction with bitfield.

2023-11-13 Thread liuhongt
if (TREE_CODE (init_expr) == INTEGER_CST) init_expr = fold_convert (TREE_TYPE (vectype), init_expr); else gcc_assert (tree_nop_conversion_p (TREE_TYPE (vectype), TREE_TYPE (init_expr))); and init_expr is a 24 bit integer type while vectype has 32bi

Re: [PATCH] Fix ICE in rtl check when bootstrap.

2023-08-07 Thread Hongtao Liu via Gcc-patches
On Mon, Aug 7, 2023 at 4:54 PM liuhongt wrote: > > /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c: > In function ‘matmul_i1_avx512f’: > /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.

[PATCH] Fix ICE in rtl check when bootstrap.

2023-08-07 Thread liuhongt via Gcc-patches
/var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c: In function ‘matmul_i1_avx512f’: /var/tmp/portage/sys-devel/gcc-14.0.0_pre20230806/work/gcc-14-20230806/libgfortran/generated/matmul_i1.c:1781:1: internal compiler error: RTL check: expected

RE: [PATCH] Fix ICE in rewrite_expr_tree_parallel

2023-05-31 Thread Cui, Lili via Gcc-patches
Committed, thanks Richard. Lili. > -Original Message- > From: Richard Biener > Sent: Wednesday, May 31, 2023 3:22 PM > To: Cui, Lili > Cc: gcc-patches@gcc.gnu.org > Subject: Re: [PATCH] Fix ICE in rewrite_expr_tree_parallel > > On Wed, May 31, 2023 at

Re: [PATCH] Fix ICE in rewrite_expr_tree_parallel

2023-05-31 Thread Richard Biener via Gcc-patches
On Wed, May 31, 2023 at 3:35 AM Cui, Lili wrote: > > Hi, > > This patch is to fix ICE in rewrite_expr_tree_parallel. > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110038 > > Bootstrapped and regtested. Ok for trunk? OK. > Regards > Lili. > > 1. Limit the value of tree-reassoc-width to IntegerRa

[PATCH] Fix ICE in rewrite_expr_tree_parallel

2023-05-30 Thread Cui, Lili via Gcc-patches
Hi, This patch is to fix ICE in rewrite_expr_tree_parallel. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110038 Bootstrapped and regtested. Ok for trunk? Regards Lili. 1. Limit the value of tree-reassoc-width to IntegerRange(0, 256). 2. Add width limit in rewrite_expr_tree_parallel. gcc/Change

[C PATCH] Fix ICE related to implicit access attributes for VLA arguments [PR105660]

2023-02-12 Thread Martin Uecker via Gcc-patches
Here is a fix for PR105660. Bootstrapped and regression tested on x86-64. Fix ICE related to implicit access attributes for VLA arguments [PR105660] When constructing the specifier string when merging an access attribute that encodes information about VLA arguments, the string

Re: [PATCH] Fix ICE when multiple speculative targets are expanded in different ltrans unit [PR93318]

2022-08-02 Thread Martin Jambor
Hi, On Thu, Jun 23 2022, Xionghu Luo via Gcc-patches wrote: > There is a corner case for speculative multiple targets, that if speculative > edges are streamed to different ltrans units, and then edges are expanded > in one ltrans unit but the speculative property is not cleared by > resolve_specu

Re: [PATCH] Fix ICE on view conversion between struct and integer

2022-07-14 Thread Richard Biener via Gcc-patches
On Thu, Jul 14, 2022 at 10:20 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > you can build a view conversion between pretty much anything in Ada including > between types with different sizes, although the compiler warns in this case > and gigi pads the smaller type to end up with the same si

[PATCH] Fix ICE on view conversion between struct and integer

2022-07-14 Thread Eric Botcazou via Gcc-patches
Hi, you can build a view conversion between pretty much anything in Ada including between types with different sizes, although the compiler warns in this case and gigi pads the smaller type to end up with the same size. The attached testcase triggers an ICE at -O or above for one of them: FAIL:

[PATCH] Fix ICE when multiple speculative targets are expanded in different ltrans unit [PR93318]

2022-06-22 Thread Xionghu Luo via Gcc-patches
There is a corner case for speculative multiple targets, that if speculative edges are streamed to different ltrans units, and then edges are expanded in one ltrans unit but the speculative property is not cleared by resolve_speculation in other ltrans unit finally cause ICE. This patch fixes this

Re: [PATCH] Fix ICE in extract_insn, at recog.cc:2791

2022-06-14 Thread Uros Bizjak via Gcc-patches
On Wed, Jun 15, 2022 at 12:49 AM liuhongt wrote: > > (In reply to Uroš Bizjak from comment #1) > > Instruction does not accept memory operand for operand 3: > > > > (define_insn_and_split > > "*_blendv_ltint" > > [(set (match_operand: 0 "register_operand" "=Yr,*x,x") > > (unspec: > >

[PATCH] Fix ICE in extract_insn, at recog.cc:2791

2022-06-14 Thread liuhongt via Gcc-patches
(In reply to Uroš Bizjak from comment #1) > Instruction does not accept memory operand for operand 3: > > (define_insn_and_split > "*_blendv_ltint" > [(set (match_operand: 0 "register_operand" "=Yr,*x,x") > (unspec: > [(match_operand: 1 "register_operand" "0,0,x") > (match_

Re: [PATCH] Fix ICE caused by NULL_RTX returned by lowpart_subreg.

2022-03-23 Thread Uros Bizjak via Gcc-patches
On Wed, Mar 23, 2022 at 7:04 AM liuhongt wrote: > > In validate_subreg, both (subreg:V2HF (reg:SI) 0) > and (subreg:V8HF (reg:V2HF) 0) are valid, but not > for (subreg:V8HF (reg:SI) 0) which causes ICE. > > Ideally it should be handled in validate_subreg to support > subreg for all modes available

Re: [PATCH] Fix ICE caused by NULL_RTX returned by lowpart_subreg.

2022-03-22 Thread Hongtao Liu via Gcc-patches
On Wed, Mar 23, 2022 at 2:05 PM liuhongt via Gcc-patches wrote: > > In validate_subreg, both (subreg:V2HF (reg:SI) 0) > and (subreg:V8HF (reg:V2HF) 0) are valid, but not > for (subreg:V8HF (reg:SI) 0) which causes ICE. > > Ideally it should be handled in validate_subreg to support > subreg for all

[PATCH] Fix ICE caused by NULL_RTX returned by lowpart_subreg.

2022-03-22 Thread liuhongt via Gcc-patches
In validate_subreg, both (subreg:V2HF (reg:SI) 0) and (subreg:V8HF (reg:V2HF) 0) are valid, but not for (subreg:V8HF (reg:SI) 0) which causes ICE. Ideally it should be handled in validate_subreg to support subreg for all modes available in TARGET_CAN_CHANGE_MODE_CLASS, but that would be too risky

Re: [PATCH] Fix ICE in lsplit when built with -O3 -fno-guess-branch-probability [PR103793]

2021-12-28 Thread Xionghu Luo via Gcc-patches
On 2021/12/29 03:33, Jan Hubicka wrote: >> -/* Proportion second loop's bb counts except those dominated by false >> - branch to avoid drop 1s down. */ >> -basic_block bbi_copy = get_bb_copy (false_edge->dest); >> -bbs2 = get_loop_body (loop2); >> -for (j = 0; j < loop2->n

Re: [PATCH] Fix ICE in lsplit when built with -O3 -fno-guess-branch-probability [PR103793]

2021-12-28 Thread Jan Hubicka via Gcc-patches
> - /* Proportion second loop's bb counts except those dominated by false > -branch to avoid drop 1s down. */ > - basic_block bbi_copy = get_bb_copy (false_edge->dest); > - bbs2 = get_loop_body (loop2); > - for (j = 0; j < loop2->num_nodes; j++) > - if (bbs2[j] == loo

Re: [PATCH] Fix ICE in lsplit when built with -O3 -fno-guess-branch-probability [PR103793]

2021-12-28 Thread Jeff Law via Gcc-patches
On 12/21/2021 7:19 PM, Xionghu Luo wrote: no-guess-branch-probability option requires profile_count with initialized_p guard. Also merge the missed part of r12-6086 of factor out function to avoid duplicate code. gcc/ChangeLog: PR 103793 * tree-ssa-loop-split.c (fix_loop_bb_

[PATCH] Fix ICE in lsplit when built with -O3 -fno-guess-branch-probability [PR103793]

2021-12-21 Thread Xionghu Luo via Gcc-patches
no-guess-branch-probability option requires profile_count with initialized_p guard. Also merge the missed part of r12-6086 of factor out function to avoid duplicate code. gcc/ChangeLog: PR 103793 * tree-ssa-loop-split.c (fix_loop_bb_probability): New function. (split_loop

Re: [patch] Fix ICE with stack checking emulation at -O2

2021-10-01 Thread Richard Biener via Gcc-patches
On Fri, Oct 1, 2021 at 10:30 AM Eric Botcazou wrote: > > > OK though I wonder if you could get away with using > > built_function_type (void_type_node, NULL_TREE); aka > > a non-prototype void f(). > > See below. > > > Did you track down what changed the requirement? > > The new function-abi.cc mo

Re: [patch] Fix ICE with stack checking emulation at -O2

2021-10-01 Thread Eric Botcazou via Gcc-patches
> OK though I wonder if you could get away with using > built_function_type (void_type_node, NULL_TREE); aka > a non-prototype void f(). See below. > Did you track down what changed the requirement? The new function-abi.cc module, so I'd rather have a correct prototype. -- Eric Botcazou

Re: [patch] Fix ICE with stack checking emulation at -O2

2021-10-01 Thread Richard Biener via Gcc-patches
On Fri, Oct 1, 2021 at 10:17 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > this is a regression present on mainline, 11 and 10 branches: on bare-metal > platforms, the Ada compiler emulates stack checking (it is required by the > language and tested by ACATS) in the runtime via the stack_che

[patch] Fix ICE with stack checking emulation at -O2

2021-10-01 Thread Eric Botcazou via Gcc-patches
Hi, this is a regression present on mainline, 11 and 10 branches: on bare-metal platforms, the Ada compiler emulates stack checking (it is required by the language and tested by ACATS) in the runtime via the stack_check_libfunc hook of the RTL middle-end. Calls to the function are generated as

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-22 Thread Uecker, Martin
Am Montag, den 16.08.2021, 06:49 +0200 schrieb Martin Uecker: > Am Montag, den 16.08.2021, 00:30 -0400 schrieb Jason Merrill: > > On 8/1/21 1:36 PM, Uecker, Martin wrote: > > > Here is an attempt to fix some old and annoying bugs related > > > to VLAs and statement expressions. In particulary, this

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-15 Thread Uecker, Martin
Am Montag, den 16.08.2021, 00:30 -0400 schrieb Jason Merrill: > On 8/1/21 1:36 PM, Uecker, Martin wrote: > > > > Here is an attempt to fix some old and annoying bugs related > > to VLAs and statement expressions. In particulary, this seems > > to fix the issues with variably-modified types which a

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-15 Thread Jason Merrill via Gcc-patches
On 8/1/21 1:36 PM, Uecker, Martin wrote: Here is an attempt to fix some old and annoying bugs related to VLAs and statement expressions. In particulary, this seems to fix the issues with variably-modified types which are returned from statement expressions (which works on clang), but there are

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-10 Thread Eric Botcazou
> Yes, it breaks Ada. I already found this out in the meanwhile. OK, thanks for checking. > My understanding of this is that this is for referring > to some field of an outer struct which is then used in the > size expression, e.g. something like this (using > C syntax): > > struct foo { > int

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-09 Thread Martin Uecker
Am Montag, den 09.08.2021, 15:52 +0200 schrieb Eric Botcazou: > > I think the patch makes sense but the comment says > > > > Java requires that we elaborated nodes in source order. That > > means we must gimplify the inner expression followed by each > > of > > the indices, in o

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-09 Thread Eric Botcazou
> I think the patch makes sense but the comment says > > Java requires that we elaborated nodes in source order. That > means we must gimplify the inner expression followed by each of > the indices, in order. But we can't gimplify the inner > expression until we deal with any

Re [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-09 Thread Uecker, Martin
Am Montag, den 02.08.2021, 16:19 +0200 schrieb Martin Uecker: > > Am Montag, den 02.08.2021, 16:05 +0200 schrieb Martin Uecker: > > > On Sun, Aug 1, 2021 at 7:37 PM Uecker, Martin > > > wrote: > > > > > > > > Here is an attempt to fix some old and annoying bugs related > > > > to VLAs and statem

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-09 Thread Uecker, Martin
Am Montag, den 02.08.2021, 16:05 +0200 schrieb Martin Uecker: > > On Sun, Aug 1, 2021 at 7:37 PM Uecker, Martin > > wrote: > > > > > > > > > Here is an attempt to fix some old and annoying bugs related > > > to VLAs and statement expressions. In particulary, this seems > > > to fix the issues

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-09 Thread Richard Biener via Gcc-patches
On Tue, Aug 3, 2021 at 9:31 PM Martin Uecker wrote: > > Am Dienstag, den 03.08.2021, 11:26 +0200 schrieb Richard Biener: > > On Tue, Aug 3, 2021 at 10:28 AM Martin Uecker wrote: > > > > > > Does the same issue arise with writing the testcases as > > > > ({ ... }) + i; > > > > ? How can we fix i

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-09 Thread Uecker, Martin
> On Sun, Aug 1, 2021 at 7:37 PM Uecker, Martin > wrote: > > > > > > > > Here is an attempt to fix some old and annoying bugs related > > to VLAs and statement expressions. In particulary, this seems > > to fix the issues with variably-modified types which are > > returned from statement expressio

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-03 Thread Martin Uecker
Am Dienstag, den 03.08.2021, 11:26 +0200 schrieb Richard Biener: > On Tue, Aug 3, 2021 at 10:28 AM Martin Uecker wrote: > > Does the same issue arise with writing the testcases as > > ({ ... }) + i; > > ? How can we fix it then if you also need to support > > i + ({ ...}); > > ? Here, t

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-03 Thread Martin Uecker
Am Dienstag, den 03.08.2021, 11:26 +0200 schrieb Richard Biener: > On Tue, Aug 3, 2021 at 10:28 AM Martin Uecker > wrote: > > > > Hi > > Am Dienstag, den 03.08.2021, 10:10 +0200 schrieb Richard Biener: > > > On Tue, Aug 3, 2021 at 7:32 AM Martin Uecker > > > wrote: > > > > > > > > (resending

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-03 Thread Richard Biener via Gcc-patches
On Tue, Aug 3, 2021 at 10:28 AM Martin Uecker wrote: > > > Hi > Am Dienstag, den 03.08.2021, 10:10 +0200 schrieb Richard Biener: > > On Tue, Aug 3, 2021 at 7:32 AM Martin Uecker wrote: > > > > > > > > > (resending from a different account, as emails seem to do not > > > go out from my other accou

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-03 Thread Martin Uecker
Hi Am Dienstag, den 03.08.2021, 10:10 +0200 schrieb Richard Biener: > On Tue, Aug 3, 2021 at 7:32 AM Martin Uecker wrote: > > > > > > (resending from a different account, as emails seem to do not > > go out from my other account at this time) > > > > Am Montag, den 02.08.2021, 16:05 +0200 sc

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-03 Thread Richard Biener via Gcc-patches
On Tue, Aug 3, 2021 at 7:32 AM Martin Uecker wrote: > > > > (resending from a different account, as emails seem to do not > go out from my other account at this time) > > Am Montag, den 02.08.2021, 16:05 +0200 schrieb Martin Uecker: > > > On Sun, Aug 1, 2021 at 7:37 PM Uecker, Martin > > > wrote:

Re: Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-02 Thread Martin Uecker
(resending from a different account, as emails seem to do not go out from my other account at this time) Am Montag, den 02.08.2021, 16:05 +0200 schrieb Martin Uecker: > > On Sun, Aug 1, 2021 at 7:37 PM Uecker, Martin > > wrote: > > > > > > > > > Here is an attempt to fix some old and annoyin

Re: [PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-02 Thread Richard Biener via Gcc-patches
On Sun, Aug 1, 2021 at 7:37 PM Uecker, Martin wrote: > > > > Here is an attempt to fix some old and annoying bugs related > to VLAs and statement expressions. In particulary, this seems > to fix the issues with variably-modified types which are > returned from statement expressions (which works on

[PATCH] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-08-01 Thread Uecker, Martin
Here is an attempt to fix some old and annoying bugs related to VLAs and statement expressions. In particulary, this seems to fix the issues with variably-modified types which are returned from statement expressions (which works on clang), but there are still bugs remaining related to structs wit

Re: [i386] [PATCH] Fix ICE when lhs is NULL [PR target/100660]

2021-05-20 Thread Richard Biener via Gcc-patches
On Fri, May 21, 2021 at 4:41 AM Hongtao Liu wrote: > > On Thu, May 20, 2021 at 4:30 PM Richard Biener > wrote: > > > > On Thu, May 20, 2021 at 10:15 AM Hongtao Liu wrote: > > > > > > On Thu, May 20, 2021 at 4:06 PM Richard Biener > > > wrote: > > > > > > > > On Thu, May 20, 2021 at 8:54 AM Hong

Re: [i386] [PATCH] Fix ICE when lhs is NULL [PR target/100660]

2021-05-20 Thread Hongtao Liu via Gcc-patches
On Thu, May 20, 2021 at 4:30 PM Richard Biener wrote: > > On Thu, May 20, 2021 at 10:15 AM Hongtao Liu wrote: > > > > On Thu, May 20, 2021 at 4:06 PM Richard Biener > > wrote: > > > > > > On Thu, May 20, 2021 at 8:54 AM Hongtao Liu wrote: > > > > > > > > Hi: > > > > In folding target-specific

Re: [i386] [PATCH] Fix ICE when lhs is NULL [PR target/100660]

2021-05-20 Thread Richard Biener via Gcc-patches
On Thu, May 20, 2021 at 10:15 AM Hongtao Liu wrote: > > On Thu, May 20, 2021 at 4:06 PM Richard Biener > wrote: > > > > On Thu, May 20, 2021 at 8:54 AM Hongtao Liu wrote: > > > > > > Hi: > > > In folding target-specific builtin, when lhs is NULL, create a > > > temporary variable for it. > > >

Re: [i386] [PATCH] Fix ICE when lhs is NULL [PR target/100660]

2021-05-20 Thread Hongtao Liu via Gcc-patches
On Thu, May 20, 2021 at 4:06 PM Richard Biener wrote: > > On Thu, May 20, 2021 at 8:54 AM Hongtao Liu wrote: > > > > Hi: > > In folding target-specific builtin, when lhs is NULL, create a > > temporary variable for it. > > Bootstrapped and regtested on x86_64-linux-gnu{-m32,} > > I would sugg

Re: [i386] [PATCH] Fix ICE when lhs is NULL [PR target/100660]

2021-05-20 Thread Jakub Jelinek via Gcc-patches
On Thu, May 20, 2021 at 10:06:36AM +0200, Richard Biener wrote: > On Thu, May 20, 2021 at 8:54 AM Hongtao Liu wrote: > > > > Hi: > > In folding target-specific builtin, when lhs is NULL, create a > > temporary variable for it. > > Bootstrapped and regtested on x86_64-linux-gnu{-m32,} > > I wo

Re: [i386] [PATCH] Fix ICE when lhs is NULL [PR target/100660]

2021-05-20 Thread Richard Biener via Gcc-patches
On Thu, May 20, 2021 at 8:54 AM Hongtao Liu wrote: > > Hi: > In folding target-specific builtin, when lhs is NULL, create a > temporary variable for it. > Bootstrapped and regtested on x86_64-linux-gnu{-m32,} I would suggest to drop the stmt or leave it unfolded instead. Note dropping would m

[i386] [PATCH] Fix ICE when lhs is NULL [PR target/100660]

2021-05-19 Thread Hongtao Liu via Gcc-patches
doesn't exist. gcc/testsuite/ChangeLog: PR target/100660 * gcc.target/i386/pr100660.c: New test. -- BR, Hongtao From b32791645429e3e25c46f56e2b81ffab7863afde Mon Sep 17 00:00:00 2001 From: liuhongt Date: Thu, 20 May 2021 09:59:36 +0800 Subject: [PATCH] Fix ICE when lhs is

Re: [PATCH] Fix ICE in output_rnglists, at dwarf2out.c:12294 [PR100515]

2021-05-17 Thread Christophe Lyon via Gcc-patches
On Wed, 12 May 2021 at 10:24, Richard Biener wrote: > > On Wed, 12 May 2021, Bernd Edlinger wrote: > > > Hi, > > > > this fixes another regression from my previous patch. > > > > > > Bootstrapped and reg-tested on x86_64-pc-linux-gnu. > > Is it OK for trunk? > > OK. > > Richard. > Hi, As the new

Re: [PATCH] Fix ICE in output_rnglists, at dwarf2out.c:12294 [PR100515]

2021-05-12 Thread Richard Biener
On Wed, 12 May 2021, Bernd Edlinger wrote: > Hi, > > this fixes another regression from my previous patch. > > > Bootstrapped and reg-tested on x86_64-pc-linux-gnu. > Is it OK for trunk? OK. Richard. > > Thanks > Bernd. >

[PATCH] Fix ICE in output_rnglists, at dwarf2out.c:12294 [PR100515]

2021-05-12 Thread Bernd Edlinger
] Fix ICE in output_rnglists, at dwarf2out.c:12294 In this testcase the compile unit consists of a single text section with a single embedded DECL_IGNORED_P function. So we have a kind of multi-range text section here. To avoid an ICE in output_rnglists we need to make sure that

Re: [PATCH] Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795 (PR99466)

2021-03-18 Thread Jeff Law via Gcc-patches
On 3/14/2021 8:03 AM, Iain Buclaw via Gcc-patches wrote: Excerpts from Iain Sandoe's message of March 13, 2021 6:09 pm: Hi Iain, Iain Buclaw via Gcc-patches wrote: This patch fixes an ICE caused by emutls routines generating a weak, non-public symbol for storing the initializer of a weak T

Re: [PATCH] Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795 (PR99466)

2021-03-14 Thread Iain Buclaw via Gcc-patches
Excerpts from Iain Sandoe's message of March 13, 2021 6:09 pm: > Hi Iain, > > Iain Buclaw via Gcc-patches wrote: > >> This patch fixes an ICE caused by emutls routines generating a weak, >> non-public symbol for storing the initializer of a weak TLS variable. >> >> In get_emutls_init_templ_addr,

Re: [PATCH] Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795 (PR99466)

2021-03-13 Thread Iain Sandoe
Hi Iain, Iain Buclaw via Gcc-patches wrote: This patch fixes an ICE caused by emutls routines generating a weak, non-public symbol for storing the initializer of a weak TLS variable. In get_emutls_init_templ_addr, only declarations that were DECL_ONE_ONLY would get a public initializer symbol

[PATCH] Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795 (PR99466)

2021-03-13 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes an ICE caused by emutls routines generating a weak, non-public symbol for storing the initializer of a weak TLS variable. In get_emutls_init_templ_addr, only declarations that were DECL_ONE_ONLY would get a public initializer symbol, ignoring variables that were declared with

Re: [PATCH] Fix ICE in tree_inlinable_function_p.

2021-02-22 Thread Richard Biener via Gcc-patches
On Sat, Feb 20, 2021 at 11:49 AM Martin Liška wrote: > > After g:1a2a7096e5e20d736c6138179470b21aa5a74864 we forbid inlining > for a VLA types. What we miss is setting inline_forbidden_reason > variable. > > Fixes: > > ./xgcc -B. -O3 -c > /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pr99122-

[PATCH] Fix ICE in tree_inlinable_function_p.

2021-02-20 Thread Martin Liška
After g:1a2a7096e5e20d736c6138179470b21aa5a74864 we forbid inlining for a VLA types. What we miss is setting inline_forbidden_reason variable. Fixes: ./xgcc -B. -O3 -c /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/pr99122-2.c -Winline during GIMPLE pass: local-fnsummary /home/marxin/Progra

Re: [PATCH] Fix ICE in warn_dealloc_offset

2020-12-24 Thread Martin Liška
On 12/23/20 6:18 PM, Martin Sebor wrote: Thanks for looking into it!  I'm actually just testing the very same fix.  It's taken me a while to come up with a non-LTO test case but below is what I've got. All right. You were faster, anyway thank you for the fix. Martin

Re: [PATCH] Fix ICE in warn_dealloc_offset

2020-12-23 Thread Martin Sebor via Gcc-patches
On 12/23/20 10:07 AM, Martin Liška wrote: Hello. I'm not fully familiar with code in warn_dealloc_offset, but I guess the following can work. Martin, what do you think? Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks for looking into it!

[PATCH] Fix ICE in warn_dealloc_offset

2020-12-23 Thread Martin Liška
Hello. I'm not fully familiar with code in warn_dealloc_offset, but I guess the following can work. Martin, what do you think? Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: PR tree-optimization/98160

Re: [PATCH] Fix ICE in vectorizable_live_operation

2020-10-15 Thread Richard Biener
On Thu, 15 Oct 2020, Jeff Law wrote: > > On 10/15/20 3:49 AM, Richard Biener wrote: > > This fixes the case where the insertion iterator for the live stmt > > is the end of a BB by adjusting the dominance query to the definition > > of the def we're substituting. > > > > Bootstrapped and tested o

Re: [PATCH] Fix ICE in vectorizable_live_operation

2020-10-15 Thread Jeff Law via Gcc-patches
On 10/15/20 3:49 AM, Richard Biener wrote: > This fixes the case where the insertion iterator for the live stmt > is the end of a BB by adjusting the dominance query to the definition > of the def we're substituting. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. > > 2020-10-15

[PATCH] Fix ICE in vectorizable_live_operation

2020-10-15 Thread Richard Biener
This fixes the case where the insertion iterator for the live stmt is the end of a BB by adjusting the dominance query to the definition of the def we're substituting. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2020-10-15 Richard Biener * tree-vect-loop.c (vectorizab

[PATCH] fix ICE with BB vectorization of PHIs

2020-10-08 Thread Richard Biener
This fixes a vector CTOR insertion issue when we try to insert after a PHI node. Bootstrap / regtest running on x86_64-unknown-linux-gnu. 2020-10-09 Richard Biener * tree-vect-slp.c (vect_create_constant_vectors): Properly insert after PHIs. * gcc.dg/vect/bb-slp-phis-

Re: [PATCH] Fix ICE in tree-switch-conversion.

2020-09-21 Thread Richard Biener via Gcc-patches
On Mon, Sep 21, 2020 at 12:53 PM Martin Liška wrote: > > With SVE we can end up with: > switch (POLY_INT_CST [2, 2]) [INV], case 2: [INV], case > 4: [INV]> > which is fine to expand and we can remove the assert. > > Ready to be installed? OK. Richard. > Thanks, > Martin > > gcc/ChangeLog: >

[PATCH] Fix ICE in tree-switch-conversion.

2020-09-21 Thread Martin Liška
With SVE we can end up with: switch (POLY_INT_CST [2, 2]) [INV], case 2: [INV], case 4: [INV]> which is fine to expand and we can remove the assert. Ready to be installed? Thanks, Martin gcc/ChangeLog: PR tree-optimization/96915 * tree-switch-conversion.c (switch_conversion:

Re: [PATCH] Fix ICE in ipa-cp due to cost addition overflow (PR 96806)

2020-09-03 Thread Feng Xue OS via Gcc-patches
>> Hi, >> >> On Mon, Aug 31 2020, Feng Xue OS wrote: >> > This patch is to fix a bug that cost that is used to evaluate clone >> > candidate >> > becomes negative due to integer overflow. >> > >> > Feng >> > --- >> > 2020-08-31 Feng Xue >> > >> > gcc/ >> > PR tree-optimization/96806 >>

Re: [PATCH] Fix ICE in ipa-cp due to cost addition overflow (PR 96806)

2020-08-31 Thread Jan Hubicka
> Hi, > > On Mon, Aug 31 2020, Feng Xue OS wrote: > > This patch is to fix a bug that cost that is used to evaluate clone > > candidate > > becomes negative due to integer overflow. > > > > Feng > > --- > > 2020-08-31 Feng Xue > > > > gcc/ > > PR tree-optimization/96806 > > the compon

Re: [PATCH] Fix ICE in ipa-cp due to cost addition overflow (PR 96806)

2020-08-31 Thread Feng Xue OS via Gcc-patches
>>> the component is "ipa," please change that when you commit the patch. >> Mistake has been made, I'v pushed it. Is there a way to correct it? git push >> --force? > > There is. You need to wait until tomorrow (after the commit message > gets copied to gcc/ChangeLog by a script) and then push a

Re: [PATCH] Fix ICE in ipa-cp due to cost addition overflow (PR 96806)

2020-08-31 Thread Martin Jambor
Hi, On Mon, Aug 31 2020, Feng Xue OS wrote: >>> gcc/ >>> PR tree-optimization/96806 > >> the component is "ipa," please change that when you commit the patch. > Mistake has been made, I'v pushed it. Is there a way to correct it? git push > --force? There is. You need to wait until tomor

Re: [PATCH] Fix ICE in ipa-cp due to cost addition overflow (PR 96806)

2020-08-31 Thread Feng Xue OS via Gcc-patches
>> gcc/ >> PR tree-optimization/96806 > the component is "ipa," please change that when you commit the patch. Mistake has been made, I'v pushed it. Is there a way to correct it? git push --force? Thanks, Feng

Re: [PATCH] Fix ICE in ipa-cp due to cost addition overflow (PR 96806)

2020-08-31 Thread Martin Jambor
Hi, On Mon, Aug 31 2020, Feng Xue OS wrote: > This patch is to fix a bug that cost that is used to evaluate clone candidate > becomes negative due to integer overflow. > > Feng > --- > 2020-08-31 Feng Xue > > gcc/ > PR tree-optimization/96806 the component is "ipa," please change that

  1   2   3   4   5   6   7   8   9   10   >