Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-31 Thread Richard Biener
On Tue, Jul 30, 2019 at 3:39 PM Martin Liška wrote: > > On 7/30/19 3:09 PM, Marc Glisse wrote: > > On Tue, 30 Jul 2019, Martin Liška wrote: > > > >> On 7/30/19 1:35 PM, Marc Glisse wrote: > >>> + /* Some delete operators have size as 2nd argument. */ > >>> > >>> Some delete operators

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Marc Glisse
On Tue, 30 Jul 2019, Martin Liška wrote: Ah, that's bad, both of them need a care: Yes, that makes more sense to me, thanks. I tried to experiment to understand, but it is complicated because including disables the optimization: #include void fn1() {     char*p=new char;     delete p; }

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Martin Liška
On 7/30/19 3:09 PM, Marc Glisse wrote: > On Tue, 30 Jul 2019, Martin Liška wrote: > >> On 7/30/19 1:35 PM, Marc Glisse wrote: >>> +  /* Some delete operators have size as 2nd argument.  */ >>> >>> Some delete operators have 3 arguments. From cp/decl.c: >>> >>>     /* operator

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Marc Glisse
On Tue, 30 Jul 2019, Martin Liška wrote: On 7/30/19 1:35 PM, Marc Glisse wrote: +  /* Some delete operators have size as 2nd argument.  */ Some delete operators have 3 arguments. From cp/decl.c:     /* operator delete (void *, size_t, align_val_t); */ Yep, I know. The

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Martin Liška
On 7/30/19 1:35 PM, Marc Glisse wrote: > +  /* Some delete operators have size as 2nd argument.  */ > > Some delete operators have 3 arguments. From cp/decl.c: > >     /* operator delete (void *, size_t, align_val_t); */ > Yep, I know. The patch I installed expects at least 2

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Marc Glisse
+ /* Some delete operators have size as 2nd argument. */ Some delete operators have 3 arguments. From cp/decl.c: /* operator delete (void *, size_t, align_val_t); */ -- Marc Glisse

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Richard Biener
On Tue, Jul 30, 2019 at 12:11 PM Martin Liška wrote: > > On 7/30/19 10:40 AM, Richard Biener wrote: > > On Tue, Jul 30, 2019 at 10:07 AM Martin Liška wrote: > >> > >> On 7/30/19 9:46 AM, Martin Liška wrote: > >>> Anyway that's not a candidate for DCE. I'm testing following patch. > >> > >> Patch

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Martin Liška
On 7/30/19 10:40 AM, Richard Biener wrote: > On Tue, Jul 30, 2019 at 10:07 AM Martin Liška wrote: >> >> On 7/30/19 9:46 AM, Martin Liška wrote: >>> Anyway that's not a candidate for DCE. I'm testing following patch. >> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests. >>

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Richard Biener
On Tue, Jul 30, 2019 at 10:07 AM Martin Liška wrote: > > On 7/30/19 9:46 AM, Martin Liška wrote: > > Anyway that's not a candidate for DCE. I'm testing following patch. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > One alternative approach can be to drop

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Martin Liška
On 7/30/19 9:46 AM, Martin Liška wrote: > Anyway that's not a candidate for DCE. I'm testing following patch. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. One alternative approach can be to drop DECL_SET_IS_OPERATOR_DELETE in: cat -n gcc/cp/decl.c | less ... 4410

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-30 Thread Martin Liška
Hi. After playing with the test-case, I noticed that we don't want to handle new/delete operators with a varying (SSA_NAME) as a second argument. Considering following test-case: $ cat /tmp/new.C struct S { S (); ~S(); }; int a = 123; void fn1() { S *s = new S[a]; delete[] s; } $

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-29 Thread Richard Biener
On Mon, Jul 29, 2019 at 12:37 PM Martin Liška wrote: > > On 7/29/19 11:59 AM, Richard Biener wrote: > > On Sun, Jul 28, 2019 at 4:57 PM Martin Liška wrote: > >> > >> Hi. > >> > >> And there's one more patch that deals with delete operator > >> which has a second argument (size). That definition

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-29 Thread Martin Liška
On 7/29/19 11:59 AM, Richard Biener wrote: > On Sun, Jul 28, 2019 at 4:57 PM Martin Liška wrote: >> >> Hi. >> >> And there's one more patch that deals with delete operator >> which has a second argument (size). That definition GIMPLE >> statement of the size must be also properly marked. >> >>

Re: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-29 Thread Richard Biener
On Sun, Jul 28, 2019 at 4:57 PM Martin Liška wrote: > > Hi. > > And there's one more patch that deals with delete operator > which has a second argument (size). That definition GIMPLE > statement of the size must be also properly marked. > > Patch can bootstrap on x86_64-linux-gnu and survives

[PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

2019-07-28 Thread Martin Liška
rom 3d69c779ad5de447cd5ddba2595d2b1586dc5d3c Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Sun, 28 Jul 2019 13:04:28 +0200 Subject: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270). gcc/ChangeLog: 2019-07-28 Martin Liska PR tree-optimization/91270 * t