Re: [PATCH] Fix PR 95481: tail call fails with empty struct types

2021-05-31 Thread H.J. Lu via Gcc-patches
On Sun, May 30, 2021 at 11:35 PM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > The problem here is we don't have an assignment type any more > for zero-length structs as they were removed during gimplifcation. > This adds a special case where the assignment var does not exist > an

Re: [PATCH] Fix PR 95481: tail call fails with empty struct types

2021-05-31 Thread Jakub Jelinek via Gcc-patches
On Mon, May 31, 2021 at 11:13:22AM +0200, Richard Biener wrote: > On Mon, May 31, 2021 at 10:29 AM Jakub Jelinek via Gcc-patches > wrote: > > > > On Sun, May 30, 2021 at 11:30:25PM -0700, apinski--- via Gcc-patches wrote: > > > +static bool > > > +zero_sized_decl (const_tree decl) > > > +{ > > > +

Re: [PATCH] Fix PR 95481: tail call fails with empty struct types

2021-05-31 Thread Richard Biener via Gcc-patches
On Mon, May 31, 2021 at 10:29 AM Jakub Jelinek via Gcc-patches wrote: > > On Sun, May 30, 2021 at 11:30:25PM -0700, apinski--- via Gcc-patches wrote: > > +static bool > > +zero_sized_decl (const_tree decl) > > +{ > > + if (!decl) > > +return true; > > + > > + tree type = TREE_TYPE (decl); >

Re: [PATCH] Fix PR 95481: tail call fails with empty struct types

2021-05-31 Thread Jakub Jelinek via Gcc-patches
On Sun, May 30, 2021 at 11:30:25PM -0700, apinski--- via Gcc-patches wrote: > +static bool > +zero_sized_decl (const_tree decl) > +{ > + if (!decl) > +return true; > + > + tree type = TREE_TYPE (decl); > + if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type) > + && integer_zerop (TYPE_SIZE (

Re: [PATCH] Fix PR 95481: tail call fails with empty struct types

2021-05-30 Thread Richard Biener via Gcc-patches
On Mon, May 31, 2021 at 8:36 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > The problem here is we don't have an assignment type any more > for zero-length structs as they were removed during gimplifcation. > This adds a special case where the assignment var does not exist > and

[PATCH] Fix PR 95481: tail call fails with empty struct types

2021-05-30 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is we don't have an assignment type any more for zero-length structs as they were removed during gimplifcation. This adds a special case where the assignment var does not exist and the return decl is zero-length. OK? Tested on aarch64-linux-gnu with no regres