Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-18 Thread Yury Gribov
On 12/18/2015 11:07 PM, Jakub Jelinek wrote: On Fri, Dec 18, 2015 at 10:40:40PM +0300, Yury Gribov wrote: So it seems most people generally agree that self-comparisons (cmp(x,x) == 0) are useless and don't need to be checked or fixed. What about ensuring symmetry i.e. that cmp(x, y) == -cmp(y, x

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-18 Thread Jakub Jelinek
On Fri, Dec 18, 2015 at 10:40:40PM +0300, Yury Gribov wrote: > So it seems most people generally agree that self-comparisons (cmp(x,x) == > 0) are useless and don't need to be checked or fixed. What about ensuring > symmetry i.e. that cmp(x, y) == -cmp(y, x) forall x, y? One of the bugs > (pair_cm

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-18 Thread Yury Gribov
On 12/17/2015 03:04 PM, Yury Gribov wrote: On 12/17/2015 02:39 PM, Jakub Jelinek wrote: On Thu, Dec 17, 2015 at 11:58:30AM +0300, Yury Gribov wrote: 2015-12-17 Yury Gribov * c-family/c-common.c (resort_field_decl_cmp): Make symmteric. * cp/class.c (method_name_cmp): Ditto. (

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Jason Merrill
The C++ changes are also for handling comparing an element to itself, which shouldn't happen; I'd prefer a gcc_checking_assert that it doesn't. Jason

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Andrew Pinski
On Thu, Dec 17, 2015 at 12:58 AM, Yury Gribov wrote: > Some obvious symmetry fixes. > > Cc-ing > * Andrey (Belevantsev) for bb_top_order_comparator > * Andrew (MacLeod) for compare_case_labels > * Andrew (Pinski) for resort_field_decl_cmp IIRC this was actually not written by me but I copied it b

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Andrey Belevantsev
On 17.12.2015 15:13, Yury Gribov wrote: On 12/17/2015 02:58 PM, Andrey Belevantsev wrote: Hello, On 17.12.2015 11:58, Yury Gribov wrote: Some obvious symmetry fixes. Cc-ing * Andrey (Belevantsev) for bb_top_order_comparator Here, as Jakub mentioned, we assume that the argument addresses wil

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Yury Gribov
On 12/17/2015 03:25 PM, Richard Biener wrote: On Thu, 17 Dec 2015, Yury Gribov wrote: On 12/17/2015 02:59 PM, Richard Biener wrote: On Thu, 17 Dec 2015, Yury Gribov wrote: On 12/17/2015 02:41 PM, Richard Biener wrote: On Thu, 17 Dec 2015, Yury Gribov wrote: Some obvious symmetry fixes. C

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Richard Biener
On Thu, 17 Dec 2015, Yury Gribov wrote: > On 12/17/2015 02:59 PM, Richard Biener wrote: > > On Thu, 17 Dec 2015, Yury Gribov wrote: > > > > > On 12/17/2015 02:41 PM, Richard Biener wrote: > > > > On Thu, 17 Dec 2015, Yury Gribov wrote: > > > > > > > > > Some obvious symmetry fixes. > > > > > >

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Yury Gribov
On 12/17/2015 02:59 PM, Richard Biener wrote: On Thu, 17 Dec 2015, Yury Gribov wrote: On 12/17/2015 02:41 PM, Richard Biener wrote: On Thu, 17 Dec 2015, Yury Gribov wrote: Some obvious symmetry fixes. Cc-ing * Andrey (Belevantsev) for bb_top_order_comparator * Andrew (MacLeod) for compare_c

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Yury Gribov
On 12/17/2015 02:58 PM, Andrey Belevantsev wrote: Hello, On 17.12.2015 11:58, Yury Gribov wrote: Some obvious symmetry fixes. Cc-ing * Andrey (Belevantsev) for bb_top_order_comparator Here, as Jakub mentioned, we assume that the argument addresses will never be equal, The problem is that t

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Yury Gribov
On 12/17/2015 02:39 PM, Jakub Jelinek wrote: On Thu, Dec 17, 2015 at 11:58:30AM +0300, Yury Gribov wrote: 2015-12-17 Yury Gribov * c-family/c-common.c (resort_field_decl_cmp): Make symmteric. * cp/class.c (method_name_cmp): Ditto. (resort_method_name_cmp): Dit

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Richard Biener
On Thu, 17 Dec 2015, Yury Gribov wrote: > On 12/17/2015 02:41 PM, Richard Biener wrote: > > On Thu, 17 Dec 2015, Yury Gribov wrote: > > > > > Some obvious symmetry fixes. > > > > > > Cc-ing > > > * Andrey (Belevantsev) for bb_top_order_comparator > > > * Andrew (MacLeod) for compare_case_labels

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Andrey Belevantsev
Hello, On 17.12.2015 11:58, Yury Gribov wrote: Some obvious symmetry fixes. Cc-ing * Andrey (Belevantsev) for bb_top_order_comparator Here, as Jakub mentioned, we assume that the argument addresses will never be equal, thus that would always be different basic blocks (the comparator is used

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Jakub Jelinek
On Thu, Dec 17, 2015 at 02:47:29PM +0300, Yury Gribov wrote: > On 12/17/2015 02:41 PM, Richard Biener wrote: > >On Thu, 17 Dec 2015, Yury Gribov wrote: > > > >>Some obvious symmetry fixes. > >> > >>Cc-ing > >>* Andrey (Belevantsev) for bb_top_order_comparator > >>* Andrew (MacLeod) for compare_case

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Yury Gribov
On 12/17/2015 02:41 PM, Richard Biener wrote: On Thu, 17 Dec 2015, Yury Gribov wrote: Some obvious symmetry fixes. Cc-ing * Andrey (Belevantsev) for bb_top_order_comparator * Andrew (MacLeod) for compare_case_labels * Andrew (Pinski) for resort_field_decl_cmp * Diego for pair_cmp * Geoff for r

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Richard Biener
On Thu, 17 Dec 2015, Yury Gribov wrote: > Some obvious symmetry fixes. > > Cc-ing > * Andrey (Belevantsev) for bb_top_order_comparator > * Andrew (MacLeod) for compare_case_labels > * Andrew (Pinski) for resort_field_decl_cmp > * Diego for pair_cmp > * Geoff for resort_method_name_cmp > * Jakub f

Re: [PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Jakub Jelinek
On Thu, Dec 17, 2015 at 11:58:30AM +0300, Yury Gribov wrote: > 2015-12-17 Yury Gribov > > * c-family/c-common.c (resort_field_decl_cmp): > Make symmteric. > * cp/class.c (method_name_cmp): Ditto. > (resort_method_name_cmp): Ditto. > * fortran/interface.c (pair_cmp)

[PATCH 1/5] Fix asymmetric comparison functions

2015-12-17 Thread Yury Gribov
* Richard for insert_phi_nodes_compare_var_infos, compare_case_labels * Steven for cmp_v_in_regset_pool /Yury >From bf924dca4ccc3f8640438400e923a4c508e898e0 Mon Sep 17 00:00:00 2001 From: Yury Gribov Date: Sat, 12 Dec 2015 09:51:54 +0300 Subject: [PATCH 1/5] Fix asymmetric comparison functions. Qs