From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id E52F23943540; Sun, 18 Apr 2021 21:30:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E52F23943540 Received: by mail-ed1-x52f.google.com with SMTP id bx20so37200109edb.12; Sun, 18 Apr 2021 14:30:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uKYHR7n11hbmb2ZipG1HBK+pYbqILQne5SHcpU3gByY=; b=XC2lEKPQs6kx1cNwYB8I7uVpHPM44BD3ZMjxew5nN4emp/OyzxCobBXuq9W6aK9diV 8+YWnGpUqwcqfzQMUwztsVnctyg6X25V+558z9QObKGsuS8HLR5wGF3/y2caATfpCZQp FclunJ37LdUgdL9vX0Zag3TfgQe6G1y5FlDsZN9965w8vuA3UrdTrW33blIJa0/CzAe6 RBc4hqEXtT2b/18Zk4YYixtdZ2llDbEufNcmep7BR2BINsqLaq/FtSxjEZ3lBQFOBmZC bOPio8NLznWZ90M5so7B0QglEl82ecm6f2JKzGVwn0T41KnGokRvrXyg5IZgAERv56RE Td1Q== X-Gm-Message-State: AOAM530TQS5jAYwJQpQiqucCvXRAuqKpR/2ckrnCai7VLtzinJeUn/Fs u3JEY8kZMoRoy2TxTyKRgww= X-Google-Smtp-Source: ABdhPJzhFbX/qCFAcwkZdAUuOws5c7sqynaTQxe7KejY4J8mFdaqLtdhd4TlnINXaFXQ9NK+JZryCQ== X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr21927768eda.70.1618781435886; Sun, 18 Apr 2021 14:30:35 -0700 (PDT) Received: from nbbrfq (62-46-112-124.adsl.highway.telekom.at. [62.46.112.124]) by smtp.gmail.com with ESMTPSA id f19sm11374952edu.12.2021.04.18.14.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 14:30:35 -0700 (PDT) Date: Sun, 18 Apr 2021 23:30:32 +0200 From: Bernhard Reutner-Fischer To: gfortran , gcc-patches Subject: Re: [PATCH,FORTRAN 00/29] Move towards stringpool, part 1 Message-ID: <20210418233032.3eb1ebb6@nbbrfq> In-Reply-To: References: <20180905145732.404-1-rep.dot.nop@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2021 21:30:43 -0000 On Fri, 7 Sep 2018 10:30:30 +0200 Bernhard Reutner-Fischer wrote: > On Thu, 6 Sep 2018 at 03:25, Jerry DeLisle wrote: > > > > On 09/05/2018 07:57 AM, Bernhard Reutner-Fischer wrote: > > > Hi, > > > > > > The fortran frontend still uses stack-based handling of (symbol) names > > > with fixed-sized buffers. Furthermore these buffers often are too small > > > when dealing with F2003 identifiers which can be up to, including 63 > > > bytes long. > > > > > > Other frontends use the stringpool since many years. > > > This janitorial series is a first step towards using the stringpool in > > > the frontend. > > > Consequently this allows us to use pointer-comparison to see if two > > > given "names" are identical instead of doing lots and lots of string > > > comparisons. > > > > > > > > > Part 1 switches most of the fortran FE. An eventual part 2 would > > > continue to switch the few remaining stack-based identifier > > > manipulations to use the stringpool. My initial plan was to also see if > > > switching gfc_symtree from treap to a hash_map would bring us any > > > measurable benefit, but that, too, is left for an eventual part 2. > > > > > > Bootstrapped and regtested on x86_64-foo-linux. > > > > > > I'd appreciate if someone could double check for regressions on other > > > setups. Git branch: > > > https://gcc.gnu.org/git/?p=gcc.git;a=log;h=refs/heads/aldot/fortran-fe-stringpool > > > > > > > I am not so git savvy as I would like. If you could send me a single > > patch to trunk I will try to test on a FreeBSD system. It is usually a > > bit more picky than linux.. > > I've just encountered a regression in module writing, let me have a > looksie at that first so i don't waste your time. > > PS: You'd: > git clone git://gcc.gnu.org/git/gcc.git ~/src/gcc-9.0-stringpool > cd ~/src/gcc-9.0-stringpool > git checkout aldot/fortran-fe-stringpool > # this should output: > # Branch aldot/fortran-fe-stringpool set up to track remote branch > aldot/fortran-fe-stringpool from origin. > # if your git client is too old, then do it manually: > # git checkout -b aldot/fortran-fe-stringpool --track > origin/aldot/fortran-fe-stringpool > mkdir -p ~/obj/gcc-9.0-stringpool > cd !$ > ../../src/gcc-9.0-stringpool/configure --prefix /opt/..... && make > install && make -k check;# as usual > > I'll send you a full patch when i had a chance to track down the > module writing bug. IIRC i fixed the abovementioned bug and pushed it to the branch. Unfortunately the abovementioned personal git branch somehow was deleted in the meantime. Now i was about to rebase my local tree in the light of the upcoming GCC-11 release and i'm confronted with a couple of conflicts that stem from /me touching all these spots that are troublesome _and_ slow (due to gazillions of strcmp calls to match identifiers; Part of the .plan was to see if sacrificing a little bit of memory to maintain hash_map of identifier_pointers would pay off WRT way faster comparison -- pointer cmp versus strcmp as noted above. ISTR that's what other frontends do since decades and i think it would make sense for the fortran FE too). Iff there is any interest in eventually accepting abovementioned direction into the tree, either part1 only which has merity on his own - as you can see from recent asan induced tweaks to our identifier handling - or also part 2 which encompasses the endavour to speedup the actual matching of identifiers and hence speed up some small parts of the frontend then i'm willing to rebase the series. Of course if nobody thinks that the proposed direction is the right thing to do then i will happily delete the effort so far. Saves quite some of my sparetime. For posteriority, a previous series of part1 was archived here: https://gcc.gnu.org/pipermail/gcc-patches/2018-September/thread.html#506111 As can bee seen in the series and was in part explained in https://gcc.gnu.org/pipermail/gcc-patches/2018-September/506849.html this series changes module format a little bit. Specifically, several spots do (or did back then, at least) use NULL module names in certain situations in a non-obvious way (i wouldn't dare to say hackish for i do not remember the gory details offhand i admit). I believe i initially wrote the series even before submodules but AFAIR they did not interfere in any noticable way. Modules were misbehaving but submodules not, IIRC. The fact that i need to change the module content was the main reason why i did not apply the batch back then, even if Jerry was kind enough to OK the submission as is, as you can see in above thread. So i again reach out for consensus so to maybe get this improvement into GCC-12 iff deemed appropriate and useful. Or i'll just drop it for good. thanks,