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

2024-04-15 Thread Jakub Jelinek
On Mon, Apr 15, 2024 at 10:02:25AM +0200, Richard Biener wrote: > > Though, haven't managed to reproduce it with -O2 -flto -std=c23 > > struct S; > > typedef struct S **V[10]; > > V **foo (int x) { return 0; } > > struct S { int s; }; > > either. > > So, maybe let's drop the ipa-free-lang-data.cc

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

2024-04-15 Thread Richard Biener
On Mon, 15 Apr 2024, Jakub Jelinek wrote: > On Mon, Apr 15, 2024 at 09:38:29AM +0200, Jakub Jelinek wrote: > > I had this spot instrumented to log the different cases (before adding the > > code to fix up also pointer types in c_update_type_canonical) and the only > > thing > > that triggered

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

2024-04-15 Thread Jakub Jelinek
On Mon, Apr 15, 2024 at 09:38:29AM +0200, Jakub Jelinek wrote: > I had this spot instrumented to log the different cases (before adding the > code to fix up also pointer types in c_update_type_canonical) and the only > thing > that triggered was that the 2 TYPE_CANONICALs weren't equal if >

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

2024-04-15 Thread Jakub Jelinek
On Mon, Apr 15, 2024 at 08:55:56AM +0200, Richard Biener wrote: > > diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc > > index 16ed55e2e5a..6f75444e513 100644 > > --- a/gcc/ipa-free-lang-data.cc > > +++ b/gcc/ipa-free-lang-data.cc > > @@ -255,7 +255,9 @@ fld_incomplete_type_of

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

2024-04-15 Thread Jakub Jelinek
On Sun, Apr 14, 2024 at 02:30:27PM +0200, Martin Uecker wrote: > 2024-04-12 Martin Uecker > Jakub Jelinek > > PR lto/114574 > PR c/114361 > gcc/ > * ipa-free-lang-data.cc (fld_incomplete_type_of): Allow > either of the types in the assert to have

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

2024-04-15 Thread Richard Biener
On Sun, 14 Apr 2024, Martin Uecker wrote: > > I had to revert the old patch because it broke LTO which lead > to PR114574. We now set TYPE_STRUCTURAL_EQUALITY and properly > update TYPE_CANONICAL for such types and also for pointers > to such types via a new function c_update_type_canonical >

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

2024-04-14 Thread Martin Uecker
(new email for Joseph) Am Sonntag, dem 14.04.2024 um 14:30 +0200 schrieb Martin Uecker: > I had to revert the old patch because it broke LTO which lead > to PR114574. We now set TYPE_STRUCTURAL_EQUALITY and properly > update TYPE_CANONICAL for such types and also for pointers > to such types

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

2024-04-14 Thread Martin Uecker
I had to revert the old patch because it broke LTO which lead to PR114574. We now set TYPE_STRUCTURAL_EQUALITY and properly update TYPE_CANONICAL for such types and also for pointers to such types via a new function c_update_type_canonical (thanks to Jakob). Bootstrapped and regession tested