From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12328 invoked by alias); 30 Mar 2015 22:28:47 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 12312 invoked by uid 89); 30 Mar 2015 22:28:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: BLU004-OMC1S33.hotmail.com Received: from blu004-omc1s33.hotmail.com (HELO BLU004-OMC1S33.hotmail.com) (65.55.116.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Mon, 30 Mar 2015 22:28:44 +0000 Received: from BLU179-W22 ([65.55.116.9]) by BLU004-OMC1S33.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 30 Mar 2015 15:28:42 -0700 X-TMN: [EdQKeIuPTCq/fsGZxGL79NG3nZ/p0q5c] Message-ID: Content-Type: multipart/mixed; boundary="_48e14428-4979-468b-a3f5-2fafd31cdd62_" From: Aditya K To: Prathamesh Kulkarni CC: Richard Biener , Trevor Saunders , "gcc@gcc.gnu.org" Subject: RE: Proposal for adding splay_tree_find (to find elements without updating the nodes). Date: Mon, 30 Mar 2015 22:28:00 -0000 In-Reply-To: References: ,,,,,,<20150315060335.GA17414@tsaunders-iceball.corp.tor1.mozilla.com>,,,,, MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00353.txt.bz2 --_48e14428-4979-468b-a3f5-2fafd31cdd62_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 6306 So I have modified the patch to use hash_map instead of std::map. The patch= is attached. However, I got one regression after that. # Comparing directories ## Dir1=3D../build-pristine/: 11 sum files ## Dir2=3D../build-test/: 11 sum files # Comparing 11 common sum files ## /bin/sh ../contrib/compare_tests =A0/tmp/gxx-sum1.29214 /tmp/gxx-sum2.29= 214 Tests that now fail, but worked before: c-c++-common/goacc/loop-private-1.c =A0-std=3Dc++98 =A0scan-tree-dump-times= gimple "#pragma acc loop collapse\\(2\\) private\\(j\\) private\\(i\\)" 1 c-c++-common/goacc/loop-private-1.c scan-tree-dump-times gimple "#pragma ac= c loop collapse\\(2\\) private\\(j\\) private\\(i\\)" 1 ## Differences found:=A0 # 1 differences in 11 common sum files found The error is due to mis-comparison because of reordering of private(i) priv= ate(j). I wanted to know if the order of the private flags matter. Thanks, -Aditya ---------------------------------------- > From: hiraditya@msn.com > To: prathamesh.kulkarni@linaro.org > CC: richard.guenther@gmail.com; tbsaunde@tbsaunde.org; gcc@gcc.gnu.org > Subject: RE: Proposal for adding splay_tree_find (to find elements withou= t updating the nodes). > Date: Wed, 18 Mar 2015 18:14:49 +0000 > > > > ---------------------------------------- >> Date: Wed, 18 Mar 2015 22:01:18 +0530 >> Subject: Re: Proposal for adding splay_tree_find (to find elements witho= ut updating the nodes). >> From: prathamesh.kulkarni@linaro.org >> To: hiraditya@msn.com >> CC: richard.guenther@gmail.com; tbsaunde@tbsaunde.org; gcc@gcc.gnu.org >> >> On 18 March 2015 at 21:20, Aditya K wrote: >>> >>> >>> ---------------------------------------- >>>> Date: Wed, 18 Mar 2015 11:50:16 +0100 >>>> Subject: Re: Proposal for adding splay_tree_find (to find elements wit= hout updating the nodes). >>>> From: richard.guenther@gmail.com >>>> To: hiraditya@msn.com >>>> CC: tbsaunde@tbsaunde.org; gcc@gcc.gnu.org >>>> >>>> On Mon, Mar 16, 2015 at 4:33 AM, Aditya K wrote: >>>>> >>>>> >>>>> ---------------------------------------- >>>>>> Date: Sun, 15 Mar 2015 02:32:23 -0400 >>>>>> From: tbsaunde@tbsaunde.org >>>>>> To: gcc@gcc.gnu.org >>>>>> Subject: Re: Proposal for adding splay_tree_find (to find elements w= ithout updating the nodes). >>>>>> >>>>>> hi, >>>>>> >>>>>> I'm only commenting on algorithmic stuff at this point, you should m= ake >>>>>> sure this doesn't regress anything in make check. This stuff only >>>>>> effects code using omp stuff so compiling random c++ is unlikely to = test >>>>>> this code at all. >>>>>> >>>>>> Also please follow the style in >>>>>> https://gcc.gnu.org/codingconventions.html >>>>>> and usually try to make new code similar to what's around it. >>>>>> >>>>>> @@ -384,7 +386,7 @@ new_omp_context (enum omp_region_type region_typ= e) >>>>>> >>>>>> c =3D XCNEW (struct gimplify_omp_ctx); >>>>>> c->outer_context =3D gimplify_omp_ctxp; >>>>>> - c->variables =3D splay_tree_new (splay_tree_compare_decl_uid, 0, 0= ); >>>>>> + //c->variables =3D splay_tree_new (splay_tree_compare_decl_uid, 0,= 0); >>>>>> >>>>>> I don't think this is what you want, xcnew is a calloc wrapper and >>>>>> doesn't call the ctor for gimplify_omp_ctx. For now placement new is >>>>>> probably the simplest way to get what you want. >>>>>> >>>>> Thanks for pointing this out. I'll do it the way c->privatized_types = has been allocated. >>>>> e.g., by making c->variables a pointer to std::map and c->variables = =3D new gimplify_tree_t; >>>>> >>>>> >>>>>> -static void >>>>>> -delete_omp_context (struct gimplify_omp_ctx *c) >>>>>> -{ >>>>>> - splay_tree_delete (c->variables); >>>>>> - delete c->privatized_types; >>>>>> - XDELETE (c); >>>>>> -} >>>>>> >>>>>> hm, why? >>>>>> >>>>> My bad, I'll restore this. >>>>> >>>>>> -gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data) >>>>>> +gimplify_adjust_omp_clauses_1 (std::pair n, void *d= ata) >>>>>> >>>>>> You can now change the type of data from void * to const >>>>>> gimplify_adjust_omp_clauses_data * >>>>> >>>>> Done! >>>>> >>>>> >>>>> Thanks for the feedback, they were really helpful. I have updated the= patch. Please review this. >>>>> Also, although I run `make check` while compiling gcc (with bootstrap= enabled), I'm not sure if 'omp' related tests were exercised. >>>>> I'm still unfamiliar with several components of gcc. Any pointers on = how to ensure all tests were run, would be useful. >>>> >>>> I'm not sure we want to use std::map. Can you use GCCs own hash_map >>>> here? >>> >>> Ok, I'll try to use has_map. I was under the impression that we can use= standard library features, that's why I used std::map. >>> >> Using std::map caused a bootstrap build problem on AIX. >> see: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02608.html >> However I am not sure if that's true any more after the following fix >> was commmited: >> https://gcc.gnu.org/ml/libstdc++/2014-10/msg00195.html >> > > Thanks for letting me know. > -Aditya > >> Regards, >> Prathamesh >>> Thanks, >>> -Aditya >>> >>>> >>>> Richard. >>>> >>>>> >>>>> -Aditya >>>>> >>>>> >>>>> >>>>> >>>>>> >>>>>> thanks! >>>>>> >>>>>> Trev >>>>>> >>>>>> On Fri, Mar 13, 2015 at 07:32:03PM +0000, Aditya K wrote: >>>>>>> You're right. I'll change this to: >>>>>>> >>>>>>> /* A stable comparison functor to sort trees. */ >>>>>>> struct tree_compare_decl_uid { >>>>>>> bool operator ()(const tree &xa, const tree &xb) const >>>>>>> { >>>>>>> return DECL_UID (xa) < DECL_UID (xb); >>>>>>> } >>>>>>> }; >>>>>>> >>>>>>> New patch attached. >>>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> -Aditya >>>>>>> >>>>>>> >>>>>>> ---------------------------------------- >>>>>>>> Date: Fri, 13 Mar 2015 19:02:11 +0000 >>>>>>>> Subject: Re: Proposal for adding splay_tree_find (to find elements= without updating the nodes). >>>>>>>> From: jwakely.gcc@gmail.com >>>>>>>> To: hiraditya@msn.com >>>>>>>> CC: richard.guenther@gmail.com; stevenb.gcc@gmail.com; gcc@gcc.gnu= .org >>>>>>>> >>>>>>>> Are you sure your compare_variables functor is correct? >>>>>>>> >>>>>>>> Subtracting the two values seems very strange for a strict weak or= dering. >>>>>>>> >>>>>>>> (Also "compare_variables" is a pretty poor name!) >>>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>> > =20=09=09=20=09=20=20=20=09=09=20=20= --_48e14428-4979-468b-a3f5-2fafd31cdd62_ Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="splay_tree.patch" Content-length: 27394 Y29tbWl0IDFhMGE4ODcwYjEwNzExZTdkMzAwZWNmY2RhYzJlN2FhOGQ5OWM0 MjkKQXV0aG9yOiBBZGl0eWEgS3VtYXIgPGFkaXR5YS5rN0BzYW1zdW5nLmNv bT4KRGF0ZTogICBNb24gTWFyIDE2IDEwOjA5OjA2IDIwMTUgLTA1MDAKCiAg ICBSZW1vdmUgc3BsYXlfdHJlZSBmcm9tIGdpbXBsaWZ5LmMKCmRpZmYgLS1n aXQgYS9nY2MvZ2ltcGxpZnkuYyBiL2djYy9naW1wbGlmeS5jCmluZGV4IGQ4 MjI5MTMuLjE4YzRiMWYgMTAwNjQ0Ci0tLSBhL2djYy9naW1wbGlmeS5jCisr KyBiL2djYy9naW1wbGlmeS5jCkBAIC05Miw2ICs5MiwyMSBAQCBhbG9uZyB3 aXRoIEdDQzsgc2VlIHRoZSBmaWxlIENPUFlJTkczLiAgSWYgbm90IHNlZQog I2luY2x1ZGUgInRyZWUtcGFzcy5oIgkJLyogRklYTUU6IG9ubHkgZm9yIFBS T1BfZ2ltcGxlX2FueSAqLwogI2luY2x1ZGUgImJ1aWx0aW5zLmgiCiAKK3N0 cnVjdCB0cmVlX2NvbXBhcmVfZGVjbF91aWQgOiBkZWZhdWx0X2hhc2htYXBf dHJhaXRzIHsKKyAgc3RhdGljIGlubGluZSBoYXNodmFsX3QgaGFzaCh0cmVl IHQpCisgIHsKKyAgICByZXR1cm4gaXRlcmF0aXZlX2hhc2hfZXhwcih0LCAw KTsKKyAgfQorCisgIHN0YXRpYyBpbmxpbmUgYm9vbCBlcXVhbF9rZXlzKGNv bnN0IHRyZWUgJnhhLCBjb25zdCB0cmVlICZ4YikKKyAgeworICAgIC8vcmV0 dXJuIHhhID09IHhiOworICAgIHJldHVybiBERUNMX1VJRCAoeGEpID09IERF Q0xfVUlEICh4Yik7CisgIH0KK307CisKK3R5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