Re: [PATCH] Remove a pointless global var

2019-08-01 Thread Richard Biener
On Thu, 1 Aug 2019, Alexander Monakov wrote: > On Thu, 1 Aug 2019, Richard Biener wrote: > > > Ugh. Yeah, it's probably some inlining parameter. OTOH I assumed > > the inliner would always inline into a simple wrapper if that makes > > the wrapped function unused - of course if we can't make th

Re: [PATCH] Remove a pointless global var

2019-08-01 Thread Alexander Monakov
On Thu, 1 Aug 2019, Richard Biener wrote: > Ugh. Yeah, it's probably some inlining parameter. OTOH I assumed > the inliner would always inline into a simple wrapper if that makes > the wrapped function unused - of course if we can't make that > function static then it cannot know... it looks li

Re: [PATCH] Remove a pointless global var

2019-08-01 Thread Richard Biener
On Thu, 1 Aug 2019, Alexander Monakov wrote: > On Thu, 1 Aug 2019, Richard Biener wrote: > > > So - were you able to allocate some cycles for this? I think > > we've settled with doing the implementation qsort_r-style while > > implementing the wrapping with fancy C++ templates. > > Yes. It wo

Re: [PATCH] Remove a pointless global var

2019-08-01 Thread Alexander Monakov
On Thu, 1 Aug 2019, Richard Biener wrote: > So - were you able to allocate some cycles for this? I think > we've settled with doing the implementation qsort_r-style while > implementing the wrapping with fancy C++ templates. Yes. It works, but not quite as perfectly as I'd hoped. I found two i

Re: [PATCH] Remove a pointless global var

2019-08-01 Thread Richard Biener
On Tue, 23 Jul 2019, Richard Biener wrote: > On Tue, 23 Jul 2019, Alexander Monakov wrote: > > > On Tue, 23 Jul 2019, Richard Biener wrote: > > > > > > Can you let me handle sort.cc changes once there's agreement > > > > which way to go? So - were you able to allocate some cycles for this? I t

Re: [PATCH] Remove a pointless global var

2019-07-23 Thread Richard Biener
On Tue, 23 Jul 2019, Alexander Monakov wrote: > On Tue, 23 Jul 2019, Richard Biener wrote: > > > > Can you let me handle sort.cc changes once there's agreement > > > which way to go? > > > > Sure - feel free to give option 3 a shot. I'm just worried > > about the system.h redirect which would b

Re: [PATCH] Remove a pointless global var

2019-07-23 Thread Alexander Monakov
On Tue, 23 Jul 2019, Richard Biener wrote: > > Can you let me handle sort.cc changes once there's agreement > > which way to go? > > Sure - feel free to give option 3 a shot. I'm just worried > about the system.h redirect which would be then disabled for C? *nod* My preference would be to poi

Re: [PATCH] Remove a pointless global var

2019-07-23 Thread Richard Biener
On Tue, 23 Jul 2019, Alexander Monakov wrote: > On Tue, 23 Jul 2019, Richard Biener wrote: > > > OK, so like below. Slight complication is that C++ doesn't allow > > the void * to int (*)() casting which means we probably have to go > > with the template wrapper. I have to check if we use gcc_q

Re: [PATCH] Remove a pointless global var

2019-07-23 Thread Alexander Monakov
On Tue, 23 Jul 2019, Richard Biener wrote: > OK, so like below. Slight complication is that C++ doesn't allow > the void * to int (*)() casting which means we probably have to go > with the template wrapper. I have to check if we use gcc_qsort > from C code, the prototypes are currently in syste

Re: [PATCH] Remove a pointless global var

2019-07-23 Thread Richard Biener
On Mon, 22 Jul 2019, Alexander Monakov wrote: > Hi! > > On Mon, 22 Jul 2019, Richard Biener wrote: > > > I've noticed that we have quite some instances using qsort > > and passing down state to the comparator via a global var. > > Now that we have our own qsort implementation I wonder what > > t

Re: [PATCH] Remove a pointless global var

2019-07-22 Thread Alexander Monakov
Hi! On Mon, 22 Jul 2019, Richard Biener wrote: > I've noticed that we have quite some instances using qsort > and passing down state to the comparator via a global var. > Now that we have our own qsort implementation I wonder what > the best course of action is to add a variant passing down > suc

[PATCH] Remove a pointless global var

2019-07-22 Thread Richard Biener
This removes label_for_bb, it's allocated and deallocated in a single function so we can just pass it down as needed. Bootstrap / regtest running on x86_64-unknown-linux-gnu. I've noticed that we have quite some instances using qsort and passing down state to the comparator via a global var. No