Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-14 Thread Ramana Radhakrishnan
On Thu, Apr 14, 2016 at 12:25 PM, Jakub Jelinek wrote: > On Thu, Apr 14, 2016 at 12:19:26PM +0100, Ramana Radhakrishnan wrote: >> Is this a valid example for what you have in mind ? >> >> struct baz >> { >> char a[1024]; >> }; >> struct foo : baz >> { >> }; >> >> int bar

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-14 Thread Jakub Jelinek
On Thu, Apr 14, 2016 at 12:19:26PM +0100, Ramana Radhakrishnan wrote: > Is this a valid example for what you have in mind ? > > struct baz > { > char a[1024]; > }; > struct foo : baz > { > }; > > int bar (struct foo b, int x) No, I meant say: struct A {}; struct B { A a[1024]; }; int bar

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-14 Thread Ramana Radhakrishnan
On Thu, Apr 14, 2016 at 11:36 AM, Jakub Jelinek wrote: > On Thu, Apr 14, 2016 at 11:25:07AM +0100, Ramana Radhakrishnan wrote: >> > I see the test failing on aarch64-none-linux-gnu (native) >> > with no output, just: >> > spawn [open ...] >> > FAIL: g++.dg/abi/empty13.C

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-14 Thread Jakub Jelinek
On Thu, Apr 14, 2016 at 11:25:07AM +0100, Ramana Radhakrishnan wrote: > > I see the test failing on aarch64-none-linux-gnu (native) > > with no output, just: > > spawn [open ...] > > FAIL: g++.dg/abi/empty13.C -std=gnu++98 execution test > > > > And I see it passing on aarch64-none-elf. > > IIRC

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-14 Thread Ramana Radhakrishnan
On Thu, Apr 14, 2016 at 10:41 AM, Kyrill Tkachov wrote: > > On 14/04/16 09:02, Christophe Lyon wrote: >> >> On 13 April 2016 at 22:12, Jason Merrill wrote: >>> >>> On 04/13/2016 03:18 PM, Jakub Jelinek wrote: On Wed, Apr 13, 2016 at

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-14 Thread Kyrill Tkachov
On 14/04/16 09:02, Christophe Lyon wrote: On 13 April 2016 at 22:12, Jason Merrill wrote: On 04/13/2016 03:18 PM, Jakub Jelinek wrote: On Wed, Apr 13, 2016 at 03:11:34PM -0400, Jason Merrill wrote: commit 761983a023b5217ef831a43f423779940c788ecf Author: Jason Merrill

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-14 Thread Christophe Lyon
On 13 April 2016 at 22:12, Jason Merrill wrote: > On 04/13/2016 03:18 PM, Jakub Jelinek wrote: >> >> On Wed, Apr 13, 2016 at 03:11:34PM -0400, Jason Merrill wrote: >>> >>> commit 761983a023b5217ef831a43f423779940c788ecf >>> Author: Jason Merrill >>> Date:

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread H.J. Lu
On Wed, Apr 13, 2016 at 1:12 PM, Jason Merrill wrote: > On 04/13/2016 03:18 PM, Jakub Jelinek wrote: >> >> On Wed, Apr 13, 2016 at 03:11:34PM -0400, Jason Merrill wrote: >>> >>> commit 761983a023b5217ef831a43f423779940c788ecf >>> Author: Jason Merrill >>>

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread H.J. Lu
On Wed, Apr 13, 2016 at 1:12 PM, Jason Merrill wrote: > On 04/13/2016 03:18 PM, Jakub Jelinek wrote: >> >> On Wed, Apr 13, 2016 at 03:11:34PM -0400, Jason Merrill wrote: >>> >>> commit 761983a023b5217ef831a43f423779940c788ecf >>> Author: Jason Merrill >>>

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread Jonathan Wakely
On 12/04/16 16:27 -0400, Jason Merrill wrote: A revision of the patch previously posted at https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00841.html To recap quickly, the C++ compiler has used a different calling convention for passing empty classes, because C++ says they have size 1, while

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread Jason Merrill
On 04/13/2016 03:18 PM, Jakub Jelinek wrote: On Wed, Apr 13, 2016 at 03:11:34PM -0400, Jason Merrill wrote: commit 761983a023b5217ef831a43f423779940c788ecf Author: Jason Merrill Date: Tue Apr 12 13:16:50 2016 -0400 gcc/ * cfgexpand.c (pass_expand::execute):

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread Jakub Jelinek
On Wed, Apr 13, 2016 at 03:11:34PM -0400, Jason Merrill wrote: > commit 761983a023b5217ef831a43f423779940c788ecf > Author: Jason Merrill > Date: Tue Apr 12 13:16:50 2016 -0400 > > gcc/ > * cfgexpand.c (pass_expand::execute): Handle attribute abi_warning. > *

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread Jason Merrill
On 04/13/2016 11:54 AM, Jason Merrill wrote: On 04/13/2016 11:32 AM, Jakub Jelinek wrote: On Tue, Apr 12, 2016 at 04:27:48PM -0400, Jason Merrill wrote: Unfortunately, a drawback of doing this in the front end is that it's difficult to warn only about affected cases; the front end doesn't know

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread Jason Merrill
On 04/13/2016 11:32 AM, Jakub Jelinek wrote: On Tue, Apr 12, 2016 at 04:27:48PM -0400, Jason Merrill wrote: Unfortunately, a drawback of doing this in the front end is that it's difficult to warn only about affected cases; the front end doesn't know what's actually going to be emitted, and has

Re: RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-13 Thread Jakub Jelinek
On Tue, Apr 12, 2016 at 04:27:48PM -0400, Jason Merrill wrote: > Unfortunately, a drawback of doing this in the front end is that it's > difficult to warn only about affected cases; the front end doesn't know > what's actually going to be emitted, and has to warn conservatively, leading > to false

RFC: C++ PATCH to adjust empty class parameter passing ABI

2016-04-12 Thread Jason Merrill
A revision of the patch previously posted at https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00841.html To recap quickly, the C++ compiler has used a different calling convention for passing empty classes, because C++ says they have size 1, while the GCC C extension gives them size 0. But