From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id 70C34385842C for ; Wed, 7 Dec 2022 17:26:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 70C34385842C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x22e.google.com with SMTP id n1so21693082ljg.3 for ; Wed, 07 Dec 2022 09:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GTm3x+/3jh0Lmrt3/IL3rOe8iiCSNthXQtugsrUNG+A=; b=CWJVr1XUTuPB4ixfSkEyUR6YDRT1OfpJsopJonWt6J7lElL8MfsWl2zdtY5r8m1DwU ejR6WSH7GXQDt7JLNBlkAnJmmogOyIzlpJNyzRsTbc/CL4/iFn7l3rF0MSYTbY6TsKQs 564s/9M5mQXhGM2oow5yKrofuENBRLI8+giv9R16fXeec+TeIdvgfAfYF2LvoydG2CUb Jmr03meVjSv63bnM2Ov6iW6usBNQl5oovbCjUpEojoyeYj1dw9plEv/HoUG7X1F3a6NC P9akKxyK9r/sDXtj0EA6uDRe3PMFZSoXxbmHbpNxQYLns8bLEavzvYmBjGR5gXE8OrSz EsjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GTm3x+/3jh0Lmrt3/IL3rOe8iiCSNthXQtugsrUNG+A=; b=Gh1thpqRzwOwtYuH/wFYyy7fM9qTb3hzULcvrUkpom/7yI4OD3AoZ3fdQNLgDsYLMm ykHS+WO8W0+zsUq6fSPAvybrl6oYtSwb0U5MyKFQ/JoVqTFt7CgC49QA93Ve81usOMIb PBbdx9v/8ski1rkyIAO34J3jYkk3arLNGsb3KDUzTCRZOz83Q8wx/0tUdJn75I77KzIf FVGnIF2n87GecHRXaTWisBcWq0KakkXjdKJW3YV2kLfqgtrOR7L//PlQ23NYZlVWZMZb +G9gwTwNdVE6rQL3KkULQCn2vsaUmUl0BZFfmzZci/Iro8/gagD5MVsD1EKjq1WBMDjj besg== X-Gm-Message-State: ANoB5pn0QiN/5NOd4WCjWAkZTf/y+PtDbJwur5scM7JIqcL/NDTIxqIh qOFMBQnLbyGSH5tzucFU/tEPd1HgFlpsRzogXu8= X-Google-Smtp-Source: AA0mqf6Omyy5yrfvb3PNWI8/6KbN4V/gz54hWTKwWIaMQeyqrPerg1rHqnwZ0WUKCPJL8ABgtzWoMOYwzNrD/awQX1U= X-Received: by 2002:a05:651c:4d0:b0:27a:b1d:5662 with SMTP id e16-20020a05651c04d000b0027a0b1d5662mr3292353lji.356.1670433999591; Wed, 07 Dec 2022 09:26:39 -0800 (PST) MIME-Version: 1.0 References: <1752ce19-956b-a055-2585-a6b0e2827572@redhat.com> In-Reply-To: <1752ce19-956b-a055-2585-a6b0e2827572@redhat.com> From: Richard Biener Date: Wed, 7 Dec 2022 18:26:27 +0100 Message-ID: Subject: Re: [PATCH] PR tree-optimization/107985 - Ensure arguments to range-op handler are supported. To: Andrew MacLeod Cc: gcc-patches , "hernandez, aldy" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Dec 7, 2022 at 5:45 PM Andrew MacLeod via Gcc-patches wrote: > > THis patch invalidates a range-op handler object if an operand type in > the statement is not supported. > > This also triggered a check in stmt dependency resolution which assumed > there must be a valid handler for any stmt with an appropriate LHS > type... which is a false assumption. > > This should do for now, but long term I will rework the dispatch code to > ensure it matches the specifically supported patterns of operands. This > will make the handler creation a little slower, but speed up the actual > dispatch, especially as we add new range types next release. Its also > much more invasive... too much for this release I think. > > bootstraps on x86_64-pc-linux-gnu with no regressions. OK? + if (!Value_Range::supports_type_p (TREE_TYPE (m_op1)) || + !Value_Range::supports_type_p (TREE_TYPE (m_op2))) The ||s go to the next line. Since in a GIMPLE_COND both operand types are compatible it's enough to check one of them. Likewise for the GIMPLE_ASSIGN case I think - I don't know of any binary operator that has operands that would not be both compatible or not compatible (but it's less clear-cut here). Otherwise looks straight forward. Thanks, Richard. > Andrew >