Re: [PATCH] cp: fix location comparison in member_name_cmp

2017-09-20 Thread Alexander Monakov
On Wed, 20 Sep 2017, Nathan Sidwell wrote: > > You can use the gcc_assert mentioned in the previous email on GCC > > bootstrap/regtest to find examples. For me, the following example breaks > > (no > > command line flags needed, just bare 'cc1plus t.i'): > > > > struct > > { > >int a, b, c,

Re: [PATCH] cp: fix location comparison in member_name_cmp

2017-09-20 Thread Nathan Sidwell
On 09/19/2017 06:07 AM, Alexander Monakov wrote: On Tue, 19 Sep 2017, Nathan Sidwell wrote: After recent changes, the member_name_cmp qsort comparator can indicate A < B < A (i.e. lacks anti-commutativity) for distinct TYPE_DECL nodes that have the same source location. If their order doesn't

Re: [PATCH] cp: fix location comparison in member_name_cmp

2017-09-19 Thread Alexander Monakov
On Tue, 19 Sep 2017, Nathan Sidwell wrote: > > > > After recent changes, the member_name_cmp qsort comparator can indicate > > > > A < B < A (i.e. lacks anti-commutativity) for distinct TYPE_DECL nodes > > > > that have the same source location. If their order doesn't matter, the > > > >

Re: [PATCH] cp: fix location comparison in member_name_cmp

2017-09-19 Thread Nathan Sidwell
On 09/19/2017 07:25 AM, Alexander Monakov wrote: On Tue, 19 Sep 2017, Nathan Sidwell wrote: On 09/19/2017 07:06 AM, Alexander Monakov wrote: Hi, After recent changes, the member_name_cmp qsort comparator can indicate A < B < A (i.e. lacks anti-commutativity) for distinct TYPE_DECL nodes that

Re: [PATCH] cp: fix location comparison in member_name_cmp

2017-09-19 Thread Alexander Monakov
On Tue, 19 Sep 2017, Nathan Sidwell wrote: > On 09/19/2017 07:06 AM, Alexander Monakov wrote: > > Hi, > > > > After recent changes, the member_name_cmp qsort comparator can indicate > > A < B < A (i.e. lacks anti-commutativity) for distinct TYPE_DECL nodes > > that have the same source location.

Re: [PATCH] cp: fix location comparison in member_name_cmp

2017-09-19 Thread Nathan Sidwell
On 09/19/2017 07:06 AM, Alexander Monakov wrote: Hi, After recent changes, the member_name_cmp qsort comparator can indicate A < B < A (i.e. lacks anti-commutativity) for distinct TYPE_DECL nodes that have the same source location. If their order doesn't matter, the comparator should return 0.

[PATCH] cp: fix location comparison in member_name_cmp

2017-09-19 Thread Alexander Monakov
Hi, After recent changes, the member_name_cmp qsort comparator can indicate A < B < A (i.e. lacks anti-commutativity) for distinct TYPE_DECL nodes that have the same source location. If their order doesn't matter, the comparator should return 0. Invoking qsort with improper comparator at best