From patchwork Sun May 16 14:33:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Rennecke X-Patchwork-Id: 1479081 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=UzjoyxEJ; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FjlBF5nDzz9s1l for ; Mon, 17 May 2021 00:33:40 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6E4083861031; Sun, 16 May 2021 14:33:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) by sourceware.org (Postfix) with ESMTPS id 8A9AB385803B for ; Sun, 16 May 2021 14:33:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8A9AB385803B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joern.rennecke@embecosm.com Received: by mail-ua1-x92c.google.com with SMTP id 20so1281929uaf.12 for ; Sun, 16 May 2021 07:33:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=/NTwo9ziwnKE3Wbua9rwJP8ccI+IkOQm3h9ztprx9to=; b=UzjoyxEJmfhd+AjZ3FUPAOTv4GM4/70nnR7wyo8AK0hOguysFtuIRIrHhFh5oqt6zt YyGY2w5rAo2Akl4y5CQiFRJdNI1wjSmoPKHy0S041yRW2u8vYUa/rCjryY3/dP0GeJTB CBV9uKC5WtTzcJsjjfudCOlP21OctxayWDr4VfAzBRbeMXywVbChWTGtrXz/UNF/cbI+ eTcnSNcl+0J4Xw6TwpHXIaNGv02FKs5vRW8dEQtLwVFIqaEwCbNn+xydvRrdJvTe5s59 Ex6c0j0rotD8OA63CKt7S5n2g0OoqH5E+ycxf7qLdKLSflKpd2fMUTKmRrBosejlon1W cE8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=/NTwo9ziwnKE3Wbua9rwJP8ccI+IkOQm3h9ztprx9to=; b=KOjQR4yUMOkba1fVUC9QUXi1Bg+35rqO+9kYk7rQ9SGsa2+2+wFmwTSFMpnhsWyXcQ QYANxc5tYAimjIeJUqOj2vqO+YK8JnKfMNQ0qQBTrh8FMfipTDFa8LGGLowkuSjnt9Zl BqKxMqz7+laENaZZ9+buEynPAFA5vAURJT0a469t2wEIGtRkWjcri2KojBpR7w/Ebghf YBlj7MzBct3l7tmaidMzQ8uwFiY9YeoBJ6CnJobtj8XmfE9q+G9aQXmh9aNxdvtMsF5w rFLoEaZmxRBTWYbuvNcmI+DF0URDA69KwSd0RlbWxIAzq2x1xnzgv+Zx74vsRCB2F6Mw BUYw== X-Gm-Message-State: AOAM532Pg6u85l1hIk1620V9ZtjbHTDx9ojOiQwKQeH2KhjQ44r3uWoW 8ieHeab/B7D1BOCh20Ru++R2Rioi1lq0kiWIGN/17vePWTbxNw== X-Google-Smtp-Source: ABdhPJw6c1Yw+vEEhA0wbdIf89crqpdfh+4THakmYInnR5xIPsW3fUd+/NdVgPdYEsOlhpZIyAp0gDsDcrsF/UkwZFg= X-Received: by 2002:ab0:3811:: with SMTP id x17mr19944045uav.69.1621175612156; Sun, 16 May 2021 07:33:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Joern Rennecke Date: Sun, 16 May 2021 15:33:21 +0100 Message-ID: Subject: RFA: Fix match_dup numbering bug in define_cond_exec To: GCC Patches X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" (Sorry about re-sending - I accidentally forgot to add a subject in the last post, which would make it hard to have a meaningful thread.) At the moment, for a match_dup in a define_cond_exec, you'd have to give the number in the resulting pattern(s) rather than in the substitute pattern. That's not only wrong, but can also be impossible when the pattern should apply to multiple patterns with different operand numbers. The attached patch fixes this. Bootstrapped on x86_64-pc-linux-gnu. 2020-12-12 Joern Rennecke Fix match_dup bug of define_cond_exec. * gensupport.c (alter_predicate_for_insn): Handle MATCH_DUP. diff --git a/gcc/gensupport.c b/gcc/gensupport.c index e1ca06dbc1e..92275358078 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -1230,6 +1230,7 @@ alter_predicate_for_insn (rtx pattern, int alt, int max_op, case MATCH_OPERATOR: case MATCH_SCRATCH: case MATCH_PARALLEL: + case MATCH_DUP: XINT (pattern, 0) += max_op; break;