Re: [C++ PATCH] PR c++/35878

2017-03-21 Thread Ville Voutilainen
On 21 March 2017 at 09:17, Jakub Jelinek wrote: > I've tested in the mean time the following patch with both gcc from yesterday > where > pr35878_3.C fails as expected, and with the latest cc1plus where > it succeeds both with -m32 and -m64. Scanning the tree dump has the > advantage that you te

Re: [C++ PATCH] PR c++/35878

2017-03-21 Thread Jakub Jelinek
On Tue, Mar 21, 2017 at 09:03:54AM +0200, Ville Voutilainen wrote: > On 21 March 2017 at 08:55, Ville Voutilainen > wrote: > >>> +// { dg-options "-O2 --std=gnu++11" } > >> > >> -O2 -std=gnu++11 is enough, no need for double dash --std=gnu++11. > >> > >>> +// { dg-do compile } > >>> +// { dg-final

Re: [C++ PATCH] PR c++/35878

2017-03-21 Thread Ville Voutilainen
On 21 March 2017 at 08:55, Ville Voutilainen wrote: >>> +// { dg-options "-O2 --std=gnu++11" } >> >> -O2 -std=gnu++11 is enough, no need for double dash --std=gnu++11. >> >>> +// { dg-do compile } >>> +// { dg-final { scan-assembler "test.*%rdi, %rdi" { target i?86-*-* >>> x86_64-*-* } } } >> >>

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Ville Voutilainen
On 21 March 2017 at 08:48, Jakub Jelinek wrote: > Formatting etc. nits: > >> 2017-03-21 Ville Voutilainen >> >> gcc/ >> >> PR c++/35878 > > This should go into gcc/cp/ ChangeLog > >> * cp/init.c (std_placement_new_fn_p): New. > > without cp/ here. Yeah, so modified before the commi

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Jakub Jelinek
Hi! On Tue, Mar 21, 2017 at 03:21:11AM +0200, Ville Voutilainen wrote: Formatting etc. nits: > 2017-03-21 Ville Voutilainen > > gcc/ > > PR c++/35878 This should go into gcc/cp/ ChangeLog > * cp/init.c (std_placement_new_fn_p): New. without cp/ here. > (build_new_1): Cal

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Jason Merrill
OK. Let's leave the BZ open to help remember to remove the cxx_dialect check in stage 1. Jason On Mon, Mar 20, 2017 at 9:21 PM, Ville Voutilainen wrote: > On 21 March 2017 at 02:46, Ville Voutilainen > wrote: >> On 21 March 2017 at 02:43, Ville Voutilainen >> wrote: >>> Hmm. I should either r

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Ville Voutilainen
On 21 March 2017 at 02:46, Ville Voutilainen wrote: > On 21 March 2017 at 02:43, Ville Voutilainen > wrote: >> Hmm. I should either rename that function or flip its logic. Now it's >> a bit backwards. :) I'll flip its logic. > > In other words, see attached. Let's call the function what it reall

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Ville Voutilainen
On 21 March 2017 at 02:43, Ville Voutilainen wrote: > Hmm. I should either rename that function or flip its logic. Now it's > a bit backwards. :) I'll flip its logic. In other words, see attached. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index dc5a5f7..a6be32e 100644 --- a/gcc/cp/init.c +++ b/g

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Ville Voutilainen
On 21 March 2017 at 02:36, Ville Voutilainen wrote: > On 21 March 2017 at 01:44, Jason Merrill wrote: >>> It looks strange to me. Why not change the definition of check_new instead >>> of changing the condition that uses it? >> >> Agreed. Also, let's factor the new tests out into a function, say

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Ville Voutilainen
On 21 March 2017 at 01:44, Jason Merrill wrote: >> It looks strange to me. Why not change the definition of check_new instead >> of changing the condition that uses it? > > Agreed. Also, let's factor the new tests out into a function, say > non_allocating_fn_p. This also conveniently let's me pr

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Jason Merrill
On Mon, Mar 20, 2017 at 7:41 PM, Marc Glisse wrote: > On Tue, 21 Mar 2017, Ville Voutilainen wrote: > >> On 20 March 2017 at 04:27, Jason Merrill wrote: >>> On Sun, Mar 19, 2017 at 6:19 PM, Ville Voutilainen >>> wrote: I ran the tests for g++.dg/init thus far. Does this patch make sense? >>

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Marc Glisse
On Tue, 21 Mar 2017, Ville Voutilainen wrote: On 20 March 2017 at 04:27, Jason Merrill wrote: On Sun, Mar 19, 2017 at 6:19 PM, Ville Voutilainen wrote: I ran the tests for g++.dg/init thus far. Does this patch make sense? The condition needs to be a lot more specific: DR 1748 only applies

Re: [C++ PATCH] PR c++/35878

2017-03-20 Thread Ville Voutilainen
On 20 March 2017 at 04:27, Jason Merrill wrote: > On Sun, Mar 19, 2017 at 6:19 PM, Ville Voutilainen > wrote: >> I ran the tests for g++.dg/init thus far. Does this patch make sense? > > The condition needs to be a lot more specific: DR 1748 only applies to > the non-allocating forms in [new.dele

Re: [C++ PATCH] PR c++/35878

2017-03-19 Thread Jason Merrill
On Sun, Mar 19, 2017 at 6:19 PM, Ville Voutilainen wrote: > I ran the tests for g++.dg/init thus far. Does this patch make sense? The condition needs to be a lot more specific: DR 1748 only applies to the non-allocating forms in [new.delete.placement], not to other placement allocation functions.

[C++ PATCH] PR c++/35878

2017-03-19 Thread Ville Voutilainen
I ran the tests for g++.dg/init thus far. Does this patch make sense? 2017-03-20 Ville Voutilainen gcc/ PR c++/35878 * cp/init.c (build_new_1): Don't do a null check for a placement new. testsuite/ PR c++/35878 * testsuite/g++.dg/init/placement6.C: New. diff --gi