From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by sourceware.org (Postfix) with ESMTPS id E9C3C38618E3 for ; Thu, 21 Dec 2023 17:47:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E9C3C38618E3 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSW.ab.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=SystematicSW.ab.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E9C3C38618E3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=216.40.44.13 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703180851; cv=none; b=MCqxvFOFA56LdxrWbWhSiEtEA5OMwiBYmi4dZUjwXJRPqe3hmkIQMz8jTxEqssgkz2zew1q4MJzkU3AUQ3b2oGkVIo21ZcC/kPjFR1C6/PSs+VUW7g6vKyYERsbTs2dzBqhtQX/ccVFprCvn0xv9SUdAcJFCsqDWdCtu6RDCAlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703180851; c=relaxed/simple; bh=7yLN9/FXi57YG35zSoI7c6nVkNgFal43ximiA9i0HL8=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=xFkiWgHhxOM1eNH5SnH2sHXL7fbr6iA4wpaXKjCFmchWkohduwqjSnaUdbPtL+O6AZ2RCmswAUyK0jEVBNEWetGqTuuqDZpMqvHinebRGCQcEvmobRjuX9iKmp9LE9DJ4QpCuR+fjviZavNZYXGMXUBMC7m/twAt7uczS2LXNb4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from omf07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 908CA40663 for ; Thu, 21 Dec 2023 17:47:29 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: Brian.Inglis@SystematicSW.ab.ca) by omf07.hostedemail.com (Postfix) with ESMTPA id 2FFE920024 for ; Thu, 21 Dec 2023 17:47:27 +0000 (UTC) Message-ID: <624e89ca-5499-425c-86b1-3b5d5eab2f43@SystematicSW.ab.ca> Date: Thu, 21 Dec 2023 10:47:26 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: newlib@sourceware.org Subject: Re: [PATCH] newlib: libc: Improved the readability of strcspn with minor optimization Content-Language: en-CA To: newlib@sourceware.org References: <20231215083101.5643-1-zengxiao@eswincomputing.com> <70b09ef7-fe4a-4669-ad27-2bd6c8bdca61@foss.st.com> <202312161730500900107@eswincomputing.com> <52a680da-61ad-486d-aaa4-d2800320791f@SystematicSW.ab.ca> <1MHoN2-1rTvdF0opK-00ExJb@mail.gmx.net> From: Brian Inglis Organization: Systematic Software In-Reply-To: <1MHoN2-1rTvdF0opK-00ExJb@mail.gmx.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FFE920024 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URI_DOTEDU autolearn=no autolearn_force=no version=3.4.6 X-Stat-Signature: 477aiqo54b1ff9cts151hjr5dcub4yi7 X-Rspamd-Server: rspamout08 X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX1/HnK+LwtPlmPRWwJ51pxdP6wn0FUgb2Bg= X-HE-Tag: 1703180847-810344 X-HE-Meta: U2FsdGVkX18IrJg581elS6jVX5iWJdKC0H57CCaNKnl2eRCvzQ1dWccE+rXT/ON4MCQD6BzDjtNj3+P7ZlVTzYMSb043dFDIOMrjerppwxW+KHI7iA2wYW0Mip34zFPeWPRPVN0GDF3XtkIJhdLYznDQvjttav2e/6TcxohpA5tspny1R9QlfYsdL0TusfsXAf0/P0xNorf7Zx9STCI+Mn4KVZSLt4f7piZG/m05on7JAC2XJHB1EN44JFayVJqxGnXI1v+cVv+n5iY6Fjq6kSVjKw2QYzSiJ55qMWAtw0lnaPAxih1IU5+y+WuyfD//PvVpKpzoivKc755APHkb5AN6MDJDCYXGo3bEIuw5NV5MpQLXSBf0aUKKkG2vHWELQiQWEsoj7MHX4kzHbVLhwg== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2023-12-21 01:00, Stefan Tauner wrote: > On Wed, 20 Dec 2023 15:24:10 -0700 Brian Inglis wrote: >> Using gotos throw away potential optimizations in modern compilers > {{citation needed}} Please note that is a simplification to make the point. No gotos means reducible flow graphs which allow easier analysis and optimization. The main problem is the creation of irreducible flow graphs using gotos. Compilers may be able to convert irreducible flow graphs to reducible flow graphs, eliminating the gotos by restructuring. This may then allow the code to meet preconditions allowing further loop or block optimizations designed for structured reducible flow graphs. See: https://groups.seas.harvard.edu/courses/cs153/2019fa/lectures/Lec23-Loop-optimization.pdf https://escholarship.mcgill.ca/concern/theses/x633f2516 -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry [I was stunned into more structured approaches early on by having to work on a large monolithic uncommented Fortran program that used *only* assigned gotos with meaningless random numeric labels and dozens of human named label variables e.g. ... 813 ASSIGN 105 to FRED GOTO JIM 534 IF (I.GT.0) GO TO JOHN GOTO JACK 105 ASSIGN 534 to ANDY GOTO MIKE ... interspersed with some matrix calculations. Aaaargh!]