This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Proposal for adding splay_tree_find (to find elements without updating the nodes).
- From: Aditya K <hiraditya at msn dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Trevor Saunders <tbsaunde at tbsaunde dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Date: Tue, 31 Mar 2015 21:47:25 +0000
- Subject: RE: Proposal for adding splay_tree_find (to find elements without updating the nodes).
- Authentication-results: sourceware.org; auth=none
- References: <BLU179-W40C136025D7BD569ABEE24B61B0 at phx dot gbl>,<CABu31nMN2KajAC4LO=RBrmxG9gHapMJmWbBC=8i_i9RyieZ5pA at mail dot gmail dot com>,<CAFiYyc3uGtRxXN_bdTSHNeBTCX41JnNT3SYs2CAyYXs0_2sR5g at mail dot gmail dot com>,<BLU179-W86E1C1E984B9AE31FCC5DBB6070 at phx dot gbl>,<CAH6eHdRWUfuVEac-4aZTayBCr5BmbzELNPEz62-FNpr44ihksw at mail dot gmail dot com>,<BLU179-W229A566D6DBF2668CBB6ACB6070 at phx dot gbl>,<20150315060335 dot GA17414 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com>,<BLU179-W61338647FCB5BE476609FB6020 at phx dot gbl>,<CAFiYyc3tbBRUT2Jof5qDi=aeL7Zy4hcb5DQoHa6CwJ9_FAS0PA at mail dot gmail dot com>,<BLU179-W3054B2B4026817EFC4905FB6000 at phx dot gbl>,<CAAgBjMnVSVKyqJPGgoOU+S4+9TshGOF437SY4-V40Sfg2vbVFw at mail dot gmail dot com>,<BLU179-W42AEA9571B2BBACC60C833B6000 at phx dot gbl> <BLU179-W22D3FE4AD8EBBA423B62F8B6F50 at phx dot gbl>,<87d23pzlqz dot fsf at kepler dot schwinge dot homeip dot net>
----------------------------------------
> From: thomas@codesourcery.com
> To: hiraditya@msn.com
> CC: richard.guenther@gmail.com; tbsaunde@tbsaunde.org; gcc@gcc.gnu.org; prathamesh.kulkarni@linaro.org
> Subject: RE: Proposal for adding splay_tree_find (to find elements without updating the nodes).
> Date: Tue, 31 Mar 2015 09:09:24 +0200
>
> Hi!
>
> On Mon, 30 Mar 2015 22:28:41 +0000, Aditya K <hiraditya@msn.com> wrote:
>> 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=../build-pristine/: 11 sum files
>> ## Dir2=../build-test/: 11 sum files
>>
>> # Comparing 11 common sum files
>> ## /bin/sh ../contrib/compare_tests /tmp/gxx-sum1.29214 /tmp/gxx-sum2.29214
>> Tests that now fail, but worked before:
>>
>> c-c++-common/goacc/loop-private-1.c -std=c++98 scan-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 acc loop collapse\\(2\\) private\\(j\\) private\\(i\\)" 1
>>
>> ## Differences found:
>> # 1 differences in 11 common sum files found
>>
>>
>> The error is due to mis-comparison because of reordering of private(i) private(j).
>>
>> I wanted to know if the order of the private flags matter.
>
> It doesn't matter. (I have not reviewed the proposed changes/patches
> themselves.)
>
Previously, I replaced splay_tree with std::map, and there were no regressions. I'm thinking this was because, std::map provides iterators to traverse the elements in a deterministic order (the sorted order) but
hash_map iterators may not have that order.
Thanks,
-Aditya
>
> Grüße,
> Thomas