From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id 034C63857C48 for ; Mon, 22 Nov 2021 16:41:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 034C63857C48 Received: by mail-qk1-x730.google.com with SMTP id t6so18801938qkg.1 for ; Mon, 22 Nov 2021 08:41:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=f6tPPv2hMkedhV6+8ZMdM11rAd0P9xtRg16A/GCwdFo=; b=uDt1/v6LrFFVHunMqUDDmfBkDB2C8w32Kmhf4OOeUfq/kpnq3j6dJ/mDeWjXsYQpFp +8F0BJYTTU829PpBCnCsqGIag48Ag6xHemR/6I3LcktKksGm0YcUWuoABuWTbri/7CtP UhctqCuiIZ//hT0B81PwwIaPztsdsBxrdIlUAMGY8SxjDobky2GatSBUqoyzZ1vP8v33 d4Fm+PxakQlQBFOjU7PGuBX7ZV5C3EGn4SYFrHaiaiwLJjfS5772HG8E5C4ANyfE/Rbf HLQfNe4PgWHniAjDWk56Tuf8mojDhoFZSF2sYEPwHWq1mqc/kF+AHrewqtERNUigPfJw 8gmA== X-Gm-Message-State: AOAM533kwfwcP1pZFZEKg9/fEYmGUxAYNqqX+NKw3gqB4PHQaWX2+SNc Z9yjIEMn2lc5eWvWPdLrwiT4apJDmRw= X-Google-Smtp-Source: ABdhPJwfWTkJ0aBV9b132pUwboOxwgKw3tbZl1O+hqmjuauVEKFAuwuqX51xsva0f5Xq+9HPncAGTw== X-Received: by 2002:a05:620a:258a:: with SMTP id x10mr48904327qko.263.1637599308489; Mon, 22 Nov 2021 08:41:48 -0800 (PST) Received: from [192.168.0.41] (184-96-250-76.hlrn.qwest.net. [184.96.250.76]) by smtp.gmail.com with ESMTPSA id w13sm4914768qko.20.2021.11.22.08.41.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Nov 2021 08:41:48 -0800 (PST) Subject: PING 2 [PATCH] fix up compute_objsize (including PR 103143) From: Martin Sebor To: gcc-patches References: <65d1e530-a4cc-de27-1198-0dcaa08274bd@gmail.com> <06573dbb-19ff-d8dd-7a7c-c4e2a47a57a5@gmail.com> Message-ID: Date: Mon, 22 Nov 2021 09:41:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <06573dbb-19ff-d8dd-7a7c-c4e2a47a57a5@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2021 16:41:50 -0000 Ping: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583735.html On 11/15/21 9:49 AM, Martin Sebor wrote: > Ping for the following cleanup patch: > https://gcc.gnu.org/pipermail/gcc-patches/2021-November/583735.html > > On 11/8/21 7:34 PM, Martin Sebor wrote: >> The pointer-query code that implements compute_objsize() that's >> in turn used by most middle end access warnings now has a few >> warts in it and (at least) one bug.  With the exception of >> the bug the warts aren't behind any user-visible bugs that >> I know of but they do cause problems in new code I've been >> implementing on top of it.  Besides fixing the one bug (just >> a typo) the attached patch cleans up these latent issues: >> >> 1) It moves the bndrng member from the access_ref class to >>     access_data.  As a FIXME in the code notes, the member never >>     did belong in the former and only takes up space in the cache. >> >> 2) The compute_objsize_r() function is big, unwieldy, and tedious >>     to step through because of all the if statements that are better >>     coded as one switch statement.  This change factors out more >>     of its code into smaller handler functions as has been suggested >>     and done a few times before. >> >> 3) (2) exposed a few places where I fail to pass the current >>     GIMPLE statement down to ranger.  This leads to worse quality >>     range info, including possible false positives and negatives. >>     I just spotted these problems in code review but I haven't >>     taken the time to come up with test cases.  This change fixes >>     these oversights as well. >> >> 4) The handling of PHI statements is also in one big, hard-to- >>     follow function.  This change moves the handling of each PHI >>     argument into its own handler which merges it into the previous >>     argument.  This makes the code easier to work with and opens it >>     to reuse also for MIN_EXPR and MAX_EXPR.  (This is primarily >>     used to print informational notes after warnings.) >> >> 5) Finally, the patch factors code to dump each access_ref >>     cached by the pointer_query cache out of pointer_query::dump >>     and into access_ref::dump.  This helps with debugging. >> >> These changes should have no user-visible effect and other than >> a regression test for the typo (PR 103143) come with no tests. >> They've been tested on x86_64-linux. >> >> Martin >