Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread H.J. Lu
On Tue, Mar 15, 2016 at 7:51 PM, Jason Merrill wrote: > On 03/15/2016 08:25 PM, Joseph Myers wrote: >> >> On Tue, 15 Mar 2016, H.J. Lu wrote: >> >>> On Tue, Mar 15, 2016 at 3:34 PM, Joseph Myers >>> wrote: On Tue, 15 Mar 2016, H.J. Lu wrote:

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread H.J. Lu
On Wed, Mar 16, 2016 at 2:45 AM, Bernhard Reutner-Fischer wrote: > On March 16, 2016 3:17:20 AM GMT+01:00, "H.J. Lu" wrote: > >>> Where is the current definition of empty types you're proposing for >>use in >>> GCC? Is the behavior of this case clear

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread H.J. Lu
On Tue, Mar 15, 2016 at 12:32 PM, Jason Merrill wrote: > On 03/15/2016 12:00 PM, H.J. Lu wrote: >> >> On Tue, Mar 15, 2016 at 8:35 AM, Jason Merrill wrote: >>> >>> I'm concerned about how this patch changes both target-independent code >>> and >>>

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread H.J. Lu
On Wed, Mar 16, 2016 at 9:58 AM, Jason Merrill wrote: > On 03/16/2016 08:38 AM, H.J. Lu wrote: >> >> FAIL: g++.dg/abi/pr60336-1.C scan-assembler jmp[\t >> ]+[^$]*?_Z3xxx9true_type >> FAIL: g++.dg/abi/pr60336-5.C scan-assembler jmp[\t >> ]+[^$]*?_Z3xxx9true_type >> FAIL:

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread Jason Merrill
On 03/16/2016 03:39 PM, H.J. Lu wrote: On Wed, Mar 16, 2016 at 10:02 AM, H.J. Lu wrote: On Wed, Mar 16, 2016 at 9:58 AM, Jason Merrill wrote: On 03/16/2016 08:38 AM, H.J. Lu wrote: FAIL: g++.dg/abi/pr60336-1.C scan-assembler jmp[\t

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread Jason Merrill
On 03/16/2016 07:55 AM, H.J. Lu wrote: On Tue, Mar 15, 2016 at 7:51 PM, Jason Merrill wrote: On 03/15/2016 08:25 PM, Joseph Myers wrote: On Tue, 15 Mar 2016, H.J. Lu wrote: On Tue, Mar 15, 2016 at 3:34 PM, Joseph Myers wrote: On Tue, 15 Mar

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread H.J. Lu
On Wed, Mar 16, 2016 at 7:33 AM, Jason Merrill wrote: > On 03/16/2016 07:55 AM, H.J. Lu wrote: >> >> On Tue, Mar 15, 2016 at 7:51 PM, Jason Merrill wrote: >>> >>> On 03/15/2016 08:25 PM, Joseph Myers wrote: On Tue, 15 Mar 2016, H.J. Lu wrote:

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-19 Thread Jason Merrill
On 03/16/2016 08:38 AM, H.J. Lu wrote: FAIL: g++.dg/abi/pr60336-1.C scan-assembler jmp[\t ]+[^$]*?_Z3xxx9true_type FAIL: g++.dg/abi/pr60336-5.C scan-assembler jmp[\t ]+[^$]*?_Z3xxx9true_type FAIL: g++.dg/abi/pr60336-6.C scan-assembler jmp[\t ]+[^$]*?_Z3xxx9true_type FAIL:

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-18 Thread H.J. Lu
On Wed, Mar 16, 2016 at 10:02 AM, H.J. Lu wrote: > On Wed, Mar 16, 2016 at 9:58 AM, Jason Merrill wrote: >> On 03/16/2016 08:38 AM, H.J. Lu wrote: >>> >>> FAIL: g++.dg/abi/pr60336-1.C scan-assembler jmp[\t >>> ]+[^$]*?_Z3xxx9true_type >>> FAIL:

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-16 Thread Bernhard Reutner-Fischer
On March 16, 2016 3:17:20 AM GMT+01:00, "H.J. Lu" wrote: >> Where is the current definition of empty types you're proposing for >use in >> GCC? Is the behavior of this case clear from that definition? > >https://gcc.gnu.org/ml/gcc/2016-03/msg00071.html > >Jason's patch

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread Jason Merrill
On 03/15/2016 08:25 PM, Joseph Myers wrote: On Tue, 15 Mar 2016, H.J. Lu wrote: On Tue, Mar 15, 2016 at 3:34 PM, Joseph Myers wrote: On Tue, 15 Mar 2016, H.J. Lu wrote: On Tue, Mar 15, 2016 at 2:39 PM, Joseph Myers wrote: I'm not sure if

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread H.J. Lu
On Tue, Mar 15, 2016 at 5:25 PM, Joseph Myers wrote: > On Tue, 15 Mar 2016, H.J. Lu wrote: > >> On Tue, Mar 15, 2016 at 3:34 PM, Joseph Myers >> wrote: >> > On Tue, 15 Mar 2016, H.J. Lu wrote: >> > >> >> On Tue, Mar 15, 2016 at 2:39 PM, Joseph

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread Joseph Myers
On Tue, 15 Mar 2016, H.J. Lu wrote: > On Tue, Mar 15, 2016 at 3:34 PM, Joseph Myers wrote: > > On Tue, 15 Mar 2016, H.J. Lu wrote: > > > >> On Tue, Mar 15, 2016 at 2:39 PM, Joseph Myers > >> wrote: > >> > I'm not sure if the zero-size arrays (a

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread H.J. Lu
On Tue, Mar 15, 2016 at 3:34 PM, Joseph Myers wrote: > On Tue, 15 Mar 2016, H.J. Lu wrote: > >> On Tue, Mar 15, 2016 at 2:39 PM, Joseph Myers >> wrote: >> > I'm not sure if the zero-size arrays (a GNU extension) are considered to >> > make a

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread Joseph Myers
On Tue, 15 Mar 2016, H.J. Lu wrote: > On Tue, Mar 15, 2016 at 2:39 PM, Joseph Myers wrote: > > I'm not sure if the zero-size arrays (a GNU extension) are considered to > > make a struct non-empty, but in any case I think the tests should cover > > such arrays as elements

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread H.J. Lu
On Tue, Mar 15, 2016 at 2:39 PM, Joseph Myers wrote: > I'm not sure if the zero-size arrays (a GNU extension) are considered to > make a struct non-empty, but in any case I think the tests should cover > such arrays as elements of structs. There are couple tests for

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread Joseph Myers
I'm not sure if the zero-size arrays (a GNU extension) are considered to make a struct non-empty, but in any case I think the tests should cover such arrays as elements of structs. -- Joseph S. Myers jos...@codesourcery.com

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread Jason Merrill
On 03/15/2016 12:00 PM, H.J. Lu wrote: On Tue, Mar 15, 2016 at 8:35 AM, Jason Merrill wrote: I'm concerned about how this patch changes both target-independent code and target-specific code, with a passing remark that other targets might need to make similar changes. I'm

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread H.J. Lu
On Tue, Mar 15, 2016 at 8:35 AM, Jason Merrill wrote: > I'm concerned about how this patch changes both target-independent code and > target-specific code, with a passing remark that other targets might need to > make similar changes. I'm also concerned about the effect of this

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-15 Thread Jason Merrill
I'm concerned about how this patch changes both target-independent code and target-specific code, with a passing remark that other targets might need to make similar changes. I'm also concerned about the effect of this on other languages that might not want the same change. So, here's an

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-02 Thread H.J. Lu
On Wed, Mar 2, 2016 at 8:25 AM, Ulrich Weigand wrote: > H.J. Lu wrote: > >> + if (type && type_is_empty_type_p (type)) >> +{ >> + if (warn_empty_type_p) >> + warn_empty_type (); >> + return NULL; >> +} > > If I understand the problem correctly, for C

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-02 Thread Ulrich Weigand
H.J. Lu wrote: > + if (type && type_is_empty_type_p (type)) > +{ > + if (warn_empty_type_p) > + warn_empty_type (); > + return NULL; > +} If I understand the problem correctly, for C code empty types already were handled correctly, the problem occured just for C++ code

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-03-01 Thread H.J. Lu
On Mon, Feb 29, 2016 at 5:02 PM, Jason Merrill wrote: > On 01/27/2016 10:39 AM, H.J. Lu wrote: >> >> Here is the updated patch with new testcases. OK for trunk? > > > This is not a complete patch. > > Please update type_is_empty_record_p to use the definition from the recent >

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-02-29 Thread Jason Merrill
On 01/27/2016 10:39 AM, H.J. Lu wrote: Here is the updated patch with new testcases. OK for trunk? This is not a complete patch. Please update type_is_empty_record_p to use the definition from the recent discussion: An empty type is a type where it and all of its subobjects (recursively)

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-27 Thread Marc Glisse
On Tue, 26 Jan 2016, H.J. Lu wrote: On Tue, Jan 26, 2016 at 1:40 PM, Jakub Jelinek wrote: On Tue, Jan 26, 2016 at 01:21:52PM -0800, H.J. Lu wrote: Like this: /* Returns true if TYPE is POD for the purpose of layout and an empty class or an class with empty classes. */

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-27 Thread Jakub Jelinek
On Wed, Jan 27, 2016 at 09:10:14AM +0100, Marc Glisse wrote: > >Revised: > > > >/* Returns true if TYPE is POD of one-byte or less in size for the purpose > > of layout and an empty class or an class with empty classes. */ > > > >static bool > >is_empty_record (tree type) > >{ > > if (type ==

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-27 Thread H.J. Lu
On Wed, Jan 27, 2016 at 5:46 AM, H.J. Lu wrote: > On Wed, Jan 27, 2016 at 1:03 AM, Marc Glisse wrote: >> On Wed, 27 Jan 2016, Jakub Jelinek wrote: >> >>> On Wed, Jan 27, 2016 at 09:10:14AM +0100, Marc Glisse wrote: > > Revised: > > /*

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-27 Thread Marc Glisse
On Wed, 27 Jan 2016, Jakub Jelinek wrote: On Wed, Jan 27, 2016 at 09:10:14AM +0100, Marc Glisse wrote: Revised: /* Returns true if TYPE is POD of one-byte or less in size for the purpose of layout and an empty class or an class with empty classes. */ static bool is_empty_record (tree type)

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-27 Thread H.J. Lu
On Wed, Jan 27, 2016 at 1:03 AM, Marc Glisse wrote: > On Wed, 27 Jan 2016, Jakub Jelinek wrote: > >> On Wed, Jan 27, 2016 at 09:10:14AM +0100, Marc Glisse wrote: Revised: /* Returns true if TYPE is POD of one-byte or less in size for the purpose

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread Jason Merrill
On 12/14/2015 05:08 PM, H.J. Lu wrote: + if (abi_version_at_least (10)) +TYPE_EMPTY_RECORD (t) = is_really_empty_class (t); This should use is_empty_class or CLASSTYPE_EMPTY_P. We don't want to change how classes with just a vptr are passed. Otherwise, it looks OK to me. Jason

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread H.J. Lu
On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill wrote: > On 12/14/2015 05:08 PM, H.J. Lu wrote: >> >> + if (abi_version_at_least (10)) >> +TYPE_EMPTY_RECORD (t) = is_really_empty_class (t); > > > This should use is_empty_class or CLASSTYPE_EMPTY_P. We don't want to >

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread Marc Glisse
On Tue, 26 Jan 2016, H.J. Lu wrote: On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill wrote: On 12/14/2015 05:08 PM, H.J. Lu wrote: + if (abi_version_at_least (10)) +TYPE_EMPTY_RECORD (t) = is_really_empty_class (t); This should use is_empty_class or

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread H.J. Lu
On Tue, Jan 26, 2016 at 12:23 PM, Marc Glisse wrote: > On Tue, 26 Jan 2016, H.J. Lu wrote: > >> On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill wrote: >>> >>> On 12/14/2015 05:08 PM, H.J. Lu wrote: + if (abi_version_at_least (10)) +

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread Marc Glisse
On Tue, 26 Jan 2016, H.J. Lu wrote: On Tue, Jan 26, 2016 at 12:23 PM, Marc Glisse wrote: On Tue, 26 Jan 2016, H.J. Lu wrote: On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill wrote: On 12/14/2015 05:08 PM, H.J. Lu wrote: + if

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread H.J. Lu
On Tue, Jan 26, 2016 at 12:44 PM, Marc Glisse wrote: > On Tue, 26 Jan 2016, H.J. Lu wrote: > >> On Tue, Jan 26, 2016 at 12:23 PM, Marc Glisse >> wrote: >>> >>> On Tue, 26 Jan 2016, H.J. Lu wrote: >>> On Tue, Jan 26, 2016 at 11:27 AM, Jason Merrill

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread Jakub Jelinek
On Tue, Jan 26, 2016 at 01:21:52PM -0800, H.J. Lu wrote: > Like this: > > /* Returns true if TYPE is POD for the purpose of layout and an empty >class or an class with empty classes. */ > > static bool > is_empty_record (tree type) > { > if (type == error_mark_node) > return false; >

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2016-01-26 Thread H.J. Lu
On Tue, Jan 26, 2016 at 1:40 PM, Jakub Jelinek wrote: > On Tue, Jan 26, 2016 at 01:21:52PM -0800, H.J. Lu wrote: >> Like this: >> >> /* Returns true if TYPE is POD for the purpose of layout and an empty >>class or an class with empty classes. */ >> >> static bool >>

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-14 Thread Jason Merrill
On 12/12/2015 01:42 PM, Marc Glisse wrote: On Sat, 12 Dec 2015, Jakub Jelinek wrote: On Sat, Dec 12, 2015 at 09:51:23AM -0500, Jason Merrill wrote: On 12/11/2015 06:52 PM, H.J. Lu wrote: On Thu, Dec 10, 2015 at 3:24 AM, Richard Biener wrote: On Wed, Dec 9, 2015

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-14 Thread H.J. Lu
On Mon, Dec 14, 2015 at 12:43 PM, Jason Merrill wrote: > On 12/14/2015 03:39 PM, H.J. Lu wrote: >> >> On Mon, Dec 14, 2015 at 12:16 PM, Jason Merrill wrote: >>> >>> On 12/12/2015 01:42 PM, Marc Glisse wrote: On Sat, 12 Dec 2015, Jakub Jelinek

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-14 Thread H.J. Lu
On Mon, Dec 14, 2015 at 12:16 PM, Jason Merrill wrote: > On 12/12/2015 01:42 PM, Marc Glisse wrote: >> >> On Sat, 12 Dec 2015, Jakub Jelinek wrote: >> >>> On Sat, Dec 12, 2015 at 09:51:23AM -0500, Jason Merrill wrote: On 12/11/2015 06:52 PM, H.J. Lu wrote: > >

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-14 Thread Jason Merrill
On 12/14/2015 03:39 PM, H.J. Lu wrote: On Mon, Dec 14, 2015 at 12:16 PM, Jason Merrill wrote: On 12/12/2015 01:42 PM, Marc Glisse wrote: On Sat, 12 Dec 2015, Jakub Jelinek wrote: On Sat, Dec 12, 2015 at 09:51:23AM -0500, Jason Merrill wrote: On 12/11/2015 06:52 PM, H.J.

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-12 Thread H.J. Lu
On Sat, Dec 12, 2015 at 7:27 AM, Jakub Jelinek wrote: > On Sat, Dec 12, 2015 at 09:51:23AM -0500, Jason Merrill wrote: >> On 12/11/2015 06:52 PM, H.J. Lu wrote: >> >On Thu, Dec 10, 2015 at 3:24 AM, Richard Biener >> > wrote: >> >>On Wed, Dec 9, 2015

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-12 Thread Jakub Jelinek
On Sat, Dec 12, 2015 at 09:51:23AM -0500, Jason Merrill wrote: > On 12/11/2015 06:52 PM, H.J. Lu wrote: > >On Thu, Dec 10, 2015 at 3:24 AM, Richard Biener > > wrote: > >>On Wed, Dec 9, 2015 at 10:31 PM, Markus Trippelsdorf > >> wrote: > >>>On

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-12 Thread Jason Merrill
On 12/11/2015 06:52 PM, H.J. Lu wrote: On Thu, Dec 10, 2015 at 3:24 AM, Richard Biener wrote: On Wed, Dec 9, 2015 at 10:31 PM, Markus Trippelsdorf wrote: On 2015.12.09 at 10:53 -0800, H.J. Lu wrote: Empty C++ class is a corner case which

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-12 Thread Marc Glisse
On Sat, 12 Dec 2015, Jakub Jelinek wrote: On Sat, Dec 12, 2015 at 09:51:23AM -0500, Jason Merrill wrote: On 12/11/2015 06:52 PM, H.J. Lu wrote: On Thu, Dec 10, 2015 at 3:24 AM, Richard Biener wrote: On Wed, Dec 9, 2015 at 10:31 PM, Markus Trippelsdorf

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-11 Thread H.J. Lu
On Thu, Dec 10, 2015 at 3:24 AM, Richard Biener wrote: > On Wed, Dec 9, 2015 at 10:31 PM, Markus Trippelsdorf > wrote: >> On 2015.12.09 at 10:53 -0800, H.J. Lu wrote: >>> >>> Empty C++ class is a corner case which isn't covered in psABI nor C++

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-10 Thread Richard Biener
On Wed, Dec 9, 2015 at 10:31 PM, Markus Trippelsdorf wrote: > On 2015.12.09 at 10:53 -0800, H.J. Lu wrote: >> >> Empty C++ class is a corner case which isn't covered in psABI nor C++ ABI. >> There is no mention of "empty record" in GCC documentation. But there are >>

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-09 Thread Richard Biener
On Tue, Dec 8, 2015 at 5:22 PM, H.J. Lu wrote: > On Mon, Nov 23, 2015 at 12:53 PM, H.J. Lu wrote: >> On Mon, Nov 23, 2015 at 1:57 AM, Richard Biener >> wrote: >>> On Sat, Nov 21, 2015 at 12:46 AM, H.J. Lu

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-09 Thread H.J. Lu
On Wed, Dec 9, 2015 at 6:05 AM, Richard Biener wrote: > On Tue, Dec 8, 2015 at 5:22 PM, H.J. Lu wrote: >> On Mon, Nov 23, 2015 at 12:53 PM, H.J. Lu wrote: >>> On Mon, Nov 23, 2015 at 1:57 AM, Richard Biener >>>

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-09 Thread H.J. Lu
On Wed, Dec 9, 2015 at 10:53 AM, H.J. Lu wrote: > On Wed, Dec 9, 2015 at 6:05 AM, Richard Biener > wrote: >> On Tue, Dec 8, 2015 at 5:22 PM, H.J. Lu wrote: >>> On Mon, Nov 23, 2015 at 12:53 PM, H.J. Lu

Re: PING^1: [PATCH] Add TYPE_EMPTY_RECORD for C++ empty class

2015-12-09 Thread Markus Trippelsdorf
On 2015.12.09 at 10:53 -0800, H.J. Lu wrote: > > Empty C++ class is a corner case which isn't covered in psABI nor C++ ABI. > There is no mention of "empty record" in GCC documentation. But there are > plenty of "empty class" in gcc/cp. This change affects all targets. C++ ABI > should specify